The Rematch persist plugin
Last but not least is the Rematch persist plugin, a plugin of just 167 bytes for handling automatic state persistence. It's built on top of the redux-persist
library (https://github.com/rt2zz/redux-persist). We can persist to hundreds of different storage services our whole Rematch store state.
Installation and configuration
Install it like all the other official Rematch plugins:
yarn add @rematch/persist redux-persist
The Rematch persist plugin also accepts some configuration through four arguments:
persistConfig
: This is the first argument and is an object compatible with theconfig
argument accepted by theredux-persist
library.nestedPersistConfig
: Whenever you need to use a nested persist configuration for some models, we can provide an object with a mapping from the model's name to theredux-persist
config for this model.persistStoreConfig
: The object compatible with the configuration argument accepted by theredux...