Given the following in ngrx4 that works:
@NgModule(
{
imports: [
CommonModule,
StoreModule.forFeature(
'clerkingData',
{
appetite: appetiteDataReducer,
bleeding: bleedingDataReducer
} ),
StoreModule.forFeature(
'clerkingUi',
{
appetite: appetiteUiReducer
} )
],
exports: [ ...modules ],
declarations:
[ ...components ],
providers:
[ ]
} )
export class ClerkingModule {
}
... Why the following does NOT. (Only 'clerking' is seen in the Devtool)
@NgModule(
{
imports: [
CommonModule,
StoreModule.forFeature(
'clerking',
{
clerkingData: {
appetite: appetiteDataReducer,
bleeding: bleedingDataReducer
},
clerkingUi: {
appetite: appetiteUiReducer
}
} )
],
exports: [ ...modules ],
declarations:
[ ...components ],
providers:
[ ]
} )
export class ClerkingModule {
}
Thanks
I don´t think the 2nd argument (ActionReducerMap) of
StoreModule.forFeature
supports nested reducers.See this issue in @ngrx/store repo. Although ngrx4 came out after this issue was created, I think it´s still relevant.