-
Notifications
You must be signed in to change notification settings - Fork 310
Another CombineReducers method #397
Comments
The output of (One of the common misuse patterns we see is Effects that only consume actions and emit other actions to affect the state - without any interaction with the outside world. Such logic is better and more simply implemented in a reducer of course.) |
@kylecordes thanks for the swift reply and an overall comment to the problem. :) I would think that there is a place for it in the |
@EddyP23 I don't see how there is anything you could add to utils that would make it any easier though. You just write a function which delegates to the output of combineReducers before or after doing its own overall reduction work. However, this should probably be visited again once the exciting new version ships with support in the box for lazy loaded additional reducers. Once that is in place, it probably would be helpful to have some explicit, named way to hand the machinery an overall reducer. |
@kylecordes Yeah, I think I get what you mean know. The remaining issue we have is that if there are some properties that child reducers don't act on, they will get removed in a new state construction, in line from utils:
What we have now in our utils 'fork' is:
This way we leave all properties of
Maybe this is something you think of including in the utils.ts? |
Please check this against NgRx v4, and if it’s still an issue, please reopen on https://github.com/ngrx/platform. Thanks! |
This is a proposal for enhancement.
There is a
combineReducers
function in utils that combines reducers that act upon elements in the object itself.Say I have the following object:
and then I have two reducers that act on
param1
andparam2
respectively.What I am looking at is having a different way of combining reducers that could combine a reducer that acts upon the whole
StoreState
object itself together with reducers that act onparam1
andparam2
separately.We have some actions that want to manage state of the whole
StoreState
objects and some that need manage sub-states. We could solve this using effects but it feels that it would over-complicate the design.The text was updated successfully, but these errors were encountered: