When should you persist and when should you rehydrate? The naming convention is very confusing as the author barely mentions what they mean in the context of redux-persist.
-
Persisting state is when you are saving redux state into some sort of storage e. g. local storage in a browser or AsyncStorage when your application runs on the Android or IOS phone. Rehidrating is when redux state is initialized with data stored in a storage. Redux state usually has to be rehidretaed upon application start and is persisted after being changed.– AlexApr 10, 2018 at 5:28
1 Answer
Without really knowing the library:
persist = writing the store to any kind of storage that survives closing your browser session.
rehydrate = reading from that storage and putting the data back into the javascript runtime, so redux can access it.
At least this is what they should mean, if not I'd recommend to ditch that library for being confusing ;)