redux-devtools/packages/redux-devtools-remote/examples/toggle-monitoring/reducers/counter.js

13 lines
297 B
JavaScript
Raw Normal View History

2021-10-28 23:39:47 +03:00
import { INCREMENT_COUNTER, DECREMENT_COUNTER } from '../actions/counter';
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;
}
}