rt2zz / redux-persist

persist and rehydrate a redux store
MIT License
12.94k stars 866 forks source link

Is it possible to delay a specific redux key? #1326

Open Acetyld opened 3 years ago

Acetyld commented 3 years ago

Hello

I had question! For example we have a store with { auth:.. books:.. authors:... notifications:... }

And i want auth,books, authors and notifications to be persisted but!

Notifications should not immediately be rehydrated on app launch. I want notifications to only be loaded from storage if i press the notifications screen for exampel

const {rehydrate} = usePersist();

useEffect(()=>{ if(variable){ rehydrate('notifications') } },[])

Is there something like this in redux-persist?

codingedgar commented 2 years ago

Maybe Nested Persist with manualPersist could build that workflow?