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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.