[NgRx] NgRx Runtime Checks

Turn on runtime check:

@NgModule({
  declarations: [AppComponent],
  imports: [
    ...,
    StoreModule.forRoot(reducers, {
      metaReducers,
      runtimeChecks: {
        strictStateImmutability: true,
        strictActionImmutability: true,
        strictActionSerializability: true,
        strictStateSerializability: true
      }
    }),
    StoreDevtoolsModule.instrument({
      maxAge: 25,
      logOnly: environment.production
    }),
    StoreRouterConnectingModule.forRoot({
      stateKey: "router",
      routerState: RouterState.Minimal
    })
  ],

 

Docs

你可能感兴趣的:([NgRx] NgRx Runtime Checks)