Open electerious opened 7 years ago
@elgerlambert Any idea on when this should be fixed and pushed out? Until that point, this is a blocker for me to use this in my application. Otherwise, it works really well!
@jdt1204 you can use a custom slicer passed to persistState
in the meantime
const slicer = paths => state => {
const subset = {}
paths.forEach(path => {
// default implementation does a falsy check on state[path],
// which means false doesn't save hrmph
subset[path] = state[path]
})
return subset
}
compose(applyMiddleware(...middleware), persistState(localStorageProps, { slicer }), devTools)
It's currently not possibly to save a path with the value
0
ornull
because the if returnsfalse
whenobj[key]
is0
ornull
. Caused me a lot of headache.I saw you're already working on v1.0, but I hope you're releasing this a bugfix for the current version. It's causing a lot of trouble in my application.
Thanks!