I have a pretty simple app, and am using ngrx for the first time
reducer.module.ts
@NgModule({
imports:[
StoreModule.forRoot({
sliceA: AReducer,
sliceB: BReducer
})
]
})
AReducer.ts
export function AReducer(state, action : AActions) {
switch(...)
}
BReducer.ts
export function AReducer(state, action : BActions) {
switch(...)
}
someComponent.ts
store.dispatch(new AAction());
Now what I would have hoped is ngrx would only trigger AReducer and not BReducer, but I see it triggering both. It's also jarring because the second argument to BReducer is an AAction, even though I parameterize the second argument to the type BAction.
So is there any way I can have ngrx only trigger the relevant reducers? Or is the design that it triggers all of them, and the irrelevant ones just trivially return the store?