redux-blower is a tiny library that helps you to improve the readability and the performance of your Redux applications.
Less code/better performance/100% test coverage
Reducer implemented with redux-blower is currently ~30% faster than regular switch statements reducer (try it on your own).
import { createReducer } from 'redux-blower';
const counterReducer = createReducer({
initialState: 0,
listenTo: {
['counter:INCREMENT'](state, action) {
return state + action.payload;
},
['counter:DECREMENT']() {
return this.state - this.action.payload;
}
}
});
counterReducer(0, { type: 'counter:INCREMENT', payload: 2 }); // => 2
counterReducer(5, { type: 'counter:DECREMENT', payload: 5 }); // => 0
npm install redux-blower
The MIT License (MIT) - See file 'LICENSE' in this project
Copyright © 2016 Jiri Chara. All Rights Reserved.