Version 4.7.0
- introduce persist
none
option which you can skip saving data into session storage and this package can be use with React Native with this config set tonone
as well
createStore(
{
yourDetail: { firstName: '', lastName: '' } // it's an object of your state
},
{
// when 'none' is used then state is not persisted
// when 'action' is used then state is saved to the storage after store action is completed
// when 'beforeUnload' is used then state is saved to storage before page unload and is restored
// after next page load and then storage is cleared
persist?: 'action' // onAction is default if not provided
},
);
huge thanks to @snax4a