diff --git a/frontend/src/hook/usePersist.js b/frontend/src/hook/usePersist.js deleted file mode 100644 index f566356..0000000 --- a/frontend/src/hook/usePersist.js +++ /dev/null @@ -1,16 +0,0 @@ -import { useEffect } from 'react'; - -const DEFAULT_STATE_KEY = 'state'; - -export const usePersistedContext = (context, key = DEFAULT_STATE_KEY) => { - const persistedContext = localStorage.getItem(key); - return persistedContext ? JSON.parse(persistedContext) : context; -}; - -export const usePersistedReducer = ([state, dispatch], key = DEFAULT_STATE_KEY) => { - useEffect( - () => localStorage.setItem(key, JSON.stringify(state)), - [key, state], - ); - return [state, dispatch]; -};