To solve the mess we are creating in app.module.ts, we will now use a method called forFeature() on StoreModule that will allow us to set up the states we need per feature module. Let's take the existing setup and refactor that:
// app.module.tsStoreModule.forRoot({ }) // this would be empty
We move our two reducer entries to their respective feature modules, counter.module.ts and jedi.module.ts. That would now look like this:
// counter.module.ts@NgModule({ imports: [StoreModule.forFeature( // add reducer object here )]})// jedi.module.ts@NgModule({ imports : [StoreModule.forFeature( // add reducer here )]})
We left out the implementation on purpose here because we need to take a step back. Remember when ...