Providing lazily loaded feature module state

We can now build out the scalable ngrx structure into our various feature modules, which will provide state. Starting with MixerModule, let's modify app/modules/mixer/mixer.module.ts with the following:

...// libsimport { StoreModule } from '@ngrx/store';...@NgModule({  imports: [    PlayerModule,    SharedModule,    

NativeScriptRouterModule.forChild(routes),    StoreModule.forFeature('mixerModule', {  

    mixer: {}     // TODO: add reducer when ready    })  ],  ...})export class MixerModule { }

Here, we are defining what the MixerModule state will provide. Now, let's define its shape; create app/modules/mixer/states/mixer.state.ts:

import { IComposition } from '../../shared/models';export interface IMixerState { compositions?: ...

Get NativeScript for Angular Mobile Development 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.