Trying to improve my apps state management i took a look into the ngrx demo app.
In example-app/app/core/containers/app.component.ts the component holds two observables initialised in the constructor. The observables are initialised with
constructor(private store: Store<fromRoot.State>) {
/**
* Selectors can be applied with the `select` operator which passes the state
* tree to the provided selector
*/
this.showSidenav$ = this.store.pipe(select(fromRoot.getShowSidenav));
this.loggedIn$ = this.store.pipe(select(fromAuth.getLoggedIn));
}
What i don't understand is, how fromAuth.getLoggedIn can be used there. The store injected is typed fromRoot.State. The root-reducer example-app/app/reducers/index.ts has no connection to the auth-state. The auth-state example-app/app/auth/reducers/index.ts does extend the root-state, so i would understand that these calls on auth-state work, but i don't get how it works the way it is.