O'Reilly logo

NativeScript for Angular Mobile Development by Nathanael J. Anderson, Nathan Walker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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?: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required