[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

转载于:https://www.cnblogs.com/Answer1215/p/11568247.html

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