在ngrx4

时间:2017-09-05 05:45:34

标签: ngrx ngrx-store ngrx-store-4.0

鉴于ngrx4中的以下内容有效:

@NgModule(
    {
      imports: [
        CommonModule,

        StoreModule.forFeature(
            'clerkingData',
            {
              appetite: appetiteDataReducer,
              bleeding: bleedingDataReducer
            } ),

        StoreModule.forFeature(
            'clerkingUi',
            {
              appetite: appetiteUiReducer
            } )
      ],
      exports: [ ...modules ],
      declarations:
          [ ...components ],
      providers:
          [ ]
    } )
export class ClerkingModule {
}

...为什么以下情况没有。(只有'职员'在开发工具中看到)

@NgModule(
    {
      imports: [
        CommonModule,

        StoreModule.forFeature(
            'clerking',
            {
              clerkingData: {
                appetite: appetiteDataReducer,
                bleeding: bleedingDataReducer
              },

              clerkingUi: {
                appetite: appetiteUiReducer
              }
            } )
      ],
      exports: [ ...modules ],
      declarations:
          [ ...components ],
      providers:
          [ ]
    } )

export class ClerkingModule {
}

由于

1 个答案:

答案 0 :(得分:0)

我不认为StoreModule.forFeature的第二个参数(ActionReducerMap)支持嵌套的reducer。

issue in @ngrx/store repo。 虽然ngrx4在创建此问题后问世,但我认为它仍然具有相关性。