Leveraging types and feature modules

The following files is pointing to the demo project Chapter9/FeatureModules.

OK, one thing we can definitely improve is how we tell the StoreModule about what state and reducers exist in our app. Let's do a quick recap and look at its current state:

// from app.module.tsStoreModule.forRoot({ count: counterReducer, jediList: JediListReducer })

So, we are essentially feeding the forRoot() method an object. What's wrong with that? Well, imagine you have ten different feature modules and every feature module may have three to four states, then the object you pass to forRoot() will grow in size and the number of imports that you need to do in your app.module.ts will grow. It will look something like this:

Get Architecting Angular Applications with Redux, RxJS, and NgRx now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.