Package Exports
- ku-ngrx-store-freeze
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ku-ngrx-store-freeze) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ngrx-store-freeze
@ngrx/store meta reducer that prevents state from being mutated. When mutation occurs, an exception will be thrown. This is useful during development mode to ensure that no part of the app accidentally mutates the state. Ported from redux-freeze
Usage
You should only include this meta reducer (middleware) in development environment.
npm i --save-dev ngrx-store-freezeimport { bootstrap } from '@angular/platform-browser-dynamic';
import { compose } from '@ngrx/core/compose';
import { combineReducers, provideStore } from '@ngrx/store';
import { storeFreeze } from 'ngrx-store-freeze';
import { TodoApp } from './todo-app.component';
import { todoReducer, visibilityFilterReducer } from './reducers'
const metaReducers = __IS_DEV__
? [storeFreeze, combineReducers]
: [combineReducers];
const store = compose(...metaReducers)({
todos: todoReducer,
visibilityFilter: visibilityFilterReducer
});
bootstrap(TodoApp, [
provideStore(store)
]);