import { useCallback, useEffect, useState } from 'react';
type CurrentWorkplace = {
company: string;
position: string;
}
type AboutMeState = {
currentWorkplace: Partial<CurrentWorkplace>;
fullName: string;
skills: string[];
}
type UseAboutMe = {
aboutMe: AboutMeState;
}
export function useAboutMe(): UseAboutMe {
const [aboutMe, setAboutMe] = useState<AboutMeState>({
currentWorkplace: {},
fullName: '',
skills: [],
});
const setFullName = useCallback(() => {
setAboutMe((prevState) => ({
...prevState,
fullName: 'Andriannus Parasian'
}));
}, []);
const setCurrentWorkplace = useCallback(() => {
setAboutMe((prevState) => ({
...prevState,
currentWorkplace: {
company: 'N/A',
position: 'N/A'
}
}));
}, []);
const setSkills = useCallback(() => {
setAboutMe((prevState) => ({
...prevState,
skills: [
'JavaScript',
'TypeScript',
'React.js',
'Vue',
'Angular',
'AJAX',
'CSS Preprocessor',
'Unit Test',
'E2E Test',
'Git',
'JIRA/ClickUp'
]
}));
}, []);
useEffect(() => {
setFullName();
setCurrentWorkplace();
setSkills();
}, [setFullName, setCurrentWorkplace, setSkills]);
return { aboutMe };
}

Rasengan
Buruh ketik terpercaya
Pinned Loading
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.