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
{{ message }}
This repository was archived by the owner on Jun 6, 2019. It is now read-only.
A common issue I've run into with RxR reducers is accessing state. The reducers must return state, but in some workflows a reducer is going to call other reducers. For example, here in fetchClientsReducer$.
If you nest the reducer calls in the curried function, then the state modifications made by those calls will be wiped when you return the old state:
(something) => (state) => {
//Call another reducer:
actionStreams.commonReducer$.next({...state.something, ...something});
// Returning this state will now undo the changes made by commonReducer
return state;
}
A common issue I've run into with RxR reducers is accessing state. The reducers must return state, but in some workflows a reducer is going to call other reducers. For example, here in fetchClientsReducer$.
If you nest the reducer calls in the curried function, then the state modifications made by those calls will be wiped when you return the old state:
You can do:
But then you don't have access to state.
I think reducers should have the option to return nothing or return undefined, and RxR should know the reducer doesn't modify state.
When I try this now, my state object is wiped.