Skip to content

Commit

Permalink
set loaded state when the new store is ready
Browse files Browse the repository at this point in the history
  • Loading branch information
eatyourgreens committed Mar 15, 2022
1 parent d613523 commit ac84f05
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export default function useSessionStorage(enableStorage, store, storageKey) {
useEffect(() => {
if (!loaded && store && enableStorage) {
persist(storageKey, store, asyncSessionStorage)
setLoaded(true)
}
setLoaded(true)
}, [enableStorage, store, loaded])

return loaded
Expand Down

0 comments on commit ac84f05

Please sign in to comment.