2016-10-26 7 views
0

は、私は次のように分けることができます。レジューサーを複数のNgModuleに分割する方法は?効果のため

@NgModule({ 
    imports: [ 
    EffectsModule.run(FooEffects) 
    ] 
}) 
export class FooModule {} 


@NgModule({ 
    imports: [ 
    EffectsModule.run(BarEffects) 
    ] 
}) 
export class BarModule {} 

次にMainModuleにこれら二つのモジュールをインポートします。

今、私はReducersを分離したいと思います。今、私はMainModule内のすべてのレデューサーを置く:

@NgModule({ 
    imports: [ 
    StoreModule.provideStore(
     compose(
     storeFreeze, 
     combineReducers 
    )({ 
     foo: fooReducer, 
     bar: barReducer 
     }) 
    ), 
    // ... 
    ], 
    // ... 
}) 
export class MainModule {} 

私はこれを試してみましたが、機能しません。

@NgModule({ 
    imports: [ 
    StoreModule.provideStore({ foo: fooReducer }) 
    ] 
}) 
export class FooModule {} 

これを分ける方法はありますか?ありがとう

答えて

1

ああ、ちょうどGitHubで問題が見つかりました。

今は不可能ですが計画中です。

hereを追跡してください。

関連する問題