Angular NgRx Store Module

    0

    0

    Jose Romero

    Angular TypeScript Recipes

    This code imports the StoreModule and then makes a call to the EffectsModule. The EffectsModule will use the environment variable production to determine if it should instrument the store. If production is not set, then the StoreDevtoolsModule will be used to instrument the store.

    Library: angular

    Shortcut: angular.ngrx.store.module

    import { NgModule } from '@angular/core';
    import { EffectsModule } from '@ngrx/effects';
    import { StoreModule } from '@ngrx/store';
    import { StoreDevtoolsModule } from '@ngrx/store-devtools';
    import { environment } from '../../environments/environment';
    
    @NgModule({
      imports: [
        StoreModule.forRoot({}),
        EffectsModule.forRoot([]),
        environment.production ? [] : StoreDevtoolsModule.instrument()
      ]
    })
    export class StoreModule {}
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.