Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/buunguyen/redux-freeze
Redux middleware that prevents state from being mutated anywhere in the app
https://github.com/buunguyen/redux-freeze
immutable react redux redux-freeze redux-middleware
Last synced: 2 days ago
JSON representation
Redux middleware that prevents state from being mutated anywhere in the app
- Host: GitHub
- URL: https://github.com/buunguyen/redux-freeze
- Owner: buunguyen
- License: mit
- Created: 2015-11-24T19:55:12.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-04-28T19:18:07.000Z (over 4 years ago)
- Last Synced: 2024-12-14T11:12:09.233Z (9 days ago)
- Topics: immutable, react, redux, redux-freeze, redux-middleware
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 213
- Watchers: 7
- Forks: 19
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
## redux-freeze
[![NPM](https://nodei.co/npm/redux-freeze.png?compact=true)](https://www.npmjs.com/package/redux-freeze)
[![Build Status](https://travis-ci.org/buunguyen/redux-freeze.svg?branch=master)](https://travis-ci.org/buunguyen/redux-freeze)
Redux middleware that prevents state from being mutated anywhere in the app. When mutation occurs, an error will be thrown by the runtime. This is useful during development mode to ensure that no part of the app accidentally mutates the state.
### Usage
```js
// Only includes in DEV mode
if (__DEV__) {
const freeze = require('redux-freeze')
reduxMiddleware.push(freeze)
}
```### Test
```bash
npm install
npm test
```### Changes
__0.1.7__
* Fix bug state not frozen before the first dispatch__0.1.5__
* Fix bug error is thrown when an object in the state has null prototype__0.1.4__
* Fix bug error is thrown when the state is not freezable__0.1.3__
* Fix bug result of the middleware is not returned