getPersistableState
Returns a state pruned from outdated data. Read more about what is removed from the state exactly.
Arguments
(state): (
object
) The current Redux state(persistOptions): (
object
) An object containing additional, optional options for the pruning:
A. (alwaysPersist): (string || array<string>
) String or array of strings containing resource name(s). Request performing on the resource(s) will always be persisted, expired or not B. (neverPersist): (string || array<string>
) String or array of strings containing resource name(s). Request performing on the resource(s) will never be persisted, expired or not
Returns
(state): A new state, pruned from outdated data
Example
This example demonstrates how to integrate redux-offline with redux-rest-easy, by creating a transform with redux-persist, a dependency of redux-offline.
Tips
persistOptions.alwaysPersist
is a great way to persist resources you would never want to expirepersistOptions.neverPersist
is a great way to clear some resources each time your app starts
Last updated