redux-loop combineReducers no return a plain object
Yeah I was so happy about the update and then I got less happy. (:
I have not used redux-loop, does it add functions to each sub reducer?
Also what is the specific error you are getting? the default serialization is JSON.serialize so it should just omit any methods and does not necessarily need to result in error.
@rt2zz The problem is with this check https://github.com/rt2zz/redux-persist/blob/master/src/persistReducer.js#L59
Using redux-loop the defaultState is an array, with the actual defaultState object in the first element and some Effects in the second one.
Let me know if you need some help to make a redux-loop integration.
ah I see. we store state in _persist as a peer to the other keys, which is a big reason we need it to be a plain object. It seems like redux-loop perhaps only temporarily changes the state shape? Im not 100% sure what integration would look like, but I would be open to reviewing a PR.
Note we are unlikely to take on any changes that will impact performance or have a large scope.
@rt2zz thanks for taking care of this. I understand that changes that impact in performance would be a problem.
Just like a note, redux-loop works excellent with redux-persist in the previous version.
ya, it may be that v4 is better fit for this case since it doesnt store any persist state. Will require more investigation to know for certain what the options are 馃憤
@rt2zz @ercpereda @bdwain About not knowing what the integration would look like, what if redux-persist took the state getter/setter argument in some way? Instead of assuming it'll be an object and getting and setting to it, it could take the functions that take the state as parameters or something.
// defaults that allow current behaviour
{ get: state => state._persist,
, set: (state, _persist) => ({...state, ._persist})
}
//
{ get: state => state[1]._persist,
set: (state, _persist) => [{...state[0], _persist}, state[1]]
}
This would allow for any kind of customised state shape to be compatible with persist, not only about redux-loop.