- switched to useSelector

- implemented skills section
This commit is contained in:
Amruth Pillai
2020-07-08 22:26:27 +05:30
parent 70866420e5
commit a1931f5e36
23 changed files with 316 additions and 191 deletions

View File

@ -86,13 +86,23 @@ const ResumeProvider = ({ children }) => {
const [state, dispatch] = useReducer(memoizedReducer, initialState);
const selectValue = (callback) => callback(state);
return (
<ResumeContext.Provider value={{ state, dispatch }}>
<ResumeContext.Provider value={{ selectValue, dispatch }}>
{children}
</ResumeContext.Provider>
);
};
export default ResumeContext;
const useSelector = (callback) => {
const { selectValue } = useContext(ResumeContext);
return selectValue(callback);
};
export { ResumeProvider };
const useDispatch = () => {
const { dispatch } = useContext(ResumeContext);
return dispatch;
};
export { ResumeProvider, useSelector, useDispatch };