redux-devtools/examples/counter/reducers/counter.js
2015-07-14 22:46:44 +03:00

13 lines
291 B
JavaScript

import { INCREMENT_COUNTER, DECREMENT_COUNTER } from '../constants/ActionTypes';
export default function counter(state = 0, action) {
switch (action.type) {
case INCREMENT_COUNTER:
return state + 1;
case DECREMENT_COUNTER:
return state - 1;
default:
return state;
}
}