Designing the state model

Before integrating ngrx, it's good to first think about the various aspects of state throughout your app in addition to which module they might pertain to. With our app, here's a reasonable starter list (not meant to be complete or thorough at this point):

  • CoreModule:
    • user: any; user-related state:
      • recentUsername: string; most recently used successful username
      • current: any; authenticated user (if there is one)
  • MixerModule:
    • mixer: any: mixer-related state
      • compositions: Array<IComposition>; list of user-saved compositions
      • activeComposition: CompositionModel; the active composition
  • PlayerModule:
    • player: any; various aspects of player state.
      • playing: boolean; whether audio is playing or not.
      • duration: ...

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.