You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In current documentation about createTransform() it unclear inboundState and outboundState parameters are full redux states to be serialized/deserialized or a value of a field of the state:
import{createTransform}from'redux-persist';constSetTransform=createTransform(// transform state on its way to being serialized and persisted.(inboundState,key)=>{// convert mySet to an Array.return{ ...inboundState,mySet: [...inboundState.mySet]};},// transform state being rehydrated(outboundState,key)=>{// convert mySet back to a Set.return{ ...outboundState,mySet: newSet(outboundState.mySet)};},// define which reducers this transform gets called for.{whitelist: ['someReducer']});exportdefaultSetTransform;
As it turns out, each function has signature (fieldValue, key, state) => newValue. I think the documentation should describe all three parameters. I can submit PR later
The text was updated successfully, but these errors were encountered:
In current documentation about
createTransform()
it unclearinboundState
andoutboundState
parameters are full redux states to be serialized/deserialized or a value of a field of the state:As it turns out, each function has signature
(fieldValue, key, state) => newValue
. I think the documentation should describe all three parameters. I can submit PR laterThe text was updated successfully, but these errors were encountered: