- fix issue with firebase-hooks

- implement custom useAuthState
This commit is contained in:
Amruth Pillai
2020-07-06 19:53:47 +05:30
parent 862ff7cdc1
commit 4e064dba96
11 changed files with 465 additions and 157 deletions

View File

@ -5,7 +5,7 @@ import DatabaseContext from "./DatabaseContext";
const ResumeContext = createContext({});
const ResumeProvider = ({ children }) => {
const { updateResume } = useContext(DatabaseContext);
const { debouncedUpdate } = useContext(DatabaseContext);
const [state, dispatch] = useReducer((state, { type, payload }) => {
let newState;
@ -13,7 +13,7 @@ const ResumeProvider = ({ children }) => {
switch (type) {
case "on_input":
newState = set({ ...state }, payload.path, payload.value);
updateResume(newState);
debouncedUpdate(newState);
return newState;
case "set_data":
return payload;