gcanti/redux-tcomb

Is it possible to provide only part of the state ?

Closed this issue · 2 comments

When using automatically generated reducer, is it possible to supply the patch function only a part of the state ? just like combineReducers can call actions with only part of the state

If you want to use combineReducers, maybe the best option is to write a standard reducer with combineReducers and apply getCheckedReducer to ge type safety

(example https://github.com/gcanti/redux-tcomb#standard-reducer where standardReducer could be defined with combineReducers).

I think that the concept of a patch function is orthogonal to combineReducers in that you can see how an event affects the whole state.

Yeah I can use getCheckedReducer, but then we lose the ability to use patch for each action, and need to create a switch statement again... I was trying to avoid that :(