Recently ngrx store changed the way to register the store variables in an angular application.
What is the difference between StoreModule.forRoot() and StoreModule.forFeature()
Do we need to register both to make the application work?
Its used with lazy loaded reducers. When you have (lazy loaded) feature modules and you want to register reducers within that module, then you use forFeature
. Otherwise, in your AppModule
you use forRoot
.