How to use the @ngrx/effects.EffectsModule.forRoot function in @ngrx/effects

To help you get started, we’ve selected a few @ngrx/effects examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github benorama / ngrx-realtime-app / client / src / app / app.module.ts View on Github external
import {AppComponent} from './app.component';
import {AppEventBusEffects} from './app.event-bus.effects';
import {AppEventBusService} from './app.event-bus.service';
import {EventBusService} from './shared/event-bus.service';

@NgModule({
    bootstrap: [
        AppComponent
    ],
    declarations: [
        AppComponent
    ],
    imports: [
        BrowserModule,
        StoreModule.forRoot(reducers),
        EffectsModule.forRoot([AppEventBusEffects]),
        !environment.production ? StoreDevtoolsModule.instrument({maxAge: 25}) : []
    ],
    providers: [
        EventBusService, // Should be first, since AppEventBusService depends on it
        AppEventBusService
    ]
})
export class AppModule {
}
github Lumeer / web-ui / src / app / core / store / app-store.module.ts View on Github external
ViewsEffects,
  VideosEffects,
  UserNotificationsEffects,
  SequencesEffects,
];

@NgModule({
  imports: [
    StoreModule.forRoot(reducers, {
      initialState: initialAppState,
      runtimeChecks: {
        strictActionImmutability: true,
        strictStateImmutability: true,
      },
    }),
    EffectsModule.forRoot(effects),
    environment.storeDevtools
      ? StoreDevtoolsModule.instrument({maxAge: 250, name: `Lumeer NgRx Store (${location.hostname})`})
      : [],
  ],
  declarations: [],
})
export class AppStoreModule {}
github ngxp / store-service / src / app / app.module.ts View on Github external
import { NewBookComponent } from './components/new-book/new-book.component';

@NgModule({
    declarations: [
        AppComponent,
        BookListComponent,
        NewBookComponent,
        BookListEntryComponent,
        BookDetailComponent
    ],
    imports: [
        BrowserModule,
        AppRoutingModule,
        FormsModule,
        StoreModule.forRoot({}),
        EffectsModule.forRoot([]),
        BookModule
    ],
    providers: [],
    bootstrap: [AppComponent]
})
export class AppModule { }
github onehungrymind / angular-ngrx-quickstart / libs / common-data / src / lib / state / state.module.ts View on Github external
import { StoreModule } from '@ngrx/store';
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
import { NxModule } from '@nrwl/nx';

import { reducers } from './index';
import { ItemsEffects } from './items/items.effects';
import { WidgetsEffects } from './widgets/widgets.effects';
import { UsersEffects } from './users/users.effects';

@NgModule({
  imports: [
    CommonModule,
    NxModule.forRoot(),
    StoreModule.forRoot(reducers),
    StoreDevtoolsModule.instrument({ maxAge: 5 }),
    EffectsModule.forRoot([ItemsEffects, WidgetsEffects, UsersEffects]),
  ],
  declarations: []
})
export class StateModule { }
github devonfw / my-thai-star / angular / src / app / core / authentication / auth-guard.service.spec.ts View on Github external
beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [
        CoreModule,
        TranslateModule.forRoot(),
        RouterTestingModule,
        EffectsModule.forRoot([]),
        StoreModule.forRoot(fromStore.reducers, {
          runtimeChecks: {
            strictStateImmutability: true,
            strictActionImmutability: true,
          },
        }),
      ],
      providers: [AuthGuardService],
    });
  });
github nrwl / ngrx-example / apps / talks / src / app / app.module.ts View on Github external
{ path: '', pathMatch: 'full', redirectTo: '/talks' },
      { path: 'talks', component: TalksAndFiltersComponent },
      { path: 'talk/:id', component: TalkDetailsComponent }
    ]),
    NxModule.forRoot(),
    StoreModule.forRoot(
      {},
      {
        metaReducers: !environment.production ? [] : [],
        runtimeChecks: {
          strictActionImmutability: true,
          strictStateImmutability: true
        }
      }
    ),
    EffectsModule.forRoot([TalksEffects]),
    !environment.production ? StoreDevtoolsModule.instrument() : [],
    StoreRouterConnectingModule.forRoot(),
    StoreModule.forFeature(fromTalks.TALKS_FEATURE_KEY, fromTalks.reducer)
  ],
  providers: [Backend, WatchService],
  bootstrap: [AppComponent]
})
export class AppModule {}
github bopm / getting-started-ng5 / src / app / app.module.ts View on Github external
const routes: Routes = [
  {path: '', redirectTo: 'about', pathMatch: 'full'},
  {path: 'about', component: AboutComponent},
  { path: 'cards', loadChildren: './cards.module#CardsModule'}
]

@NgModule({
  declarations: [
    AppComponent,
    AboutComponent,
  ],
  imports: [
    BrowserModule,
    RouterModule.forRoot(routes, {useHash: true}),
    StoreModule.forRoot(reducers, { metaReducers }),
    EffectsModule.forRoot([]),
  ],
  
  bootstrap: [AppComponent]
})
export class AppModule { }