counter.js 325 B

1234567891011121314
  1. import * as types from "../constants/ActionTypes";
  2. import initialState from "../initialState";
  3. export default (state = initialState.counter, action) => {
  4. switch (action.type) {
  5. case types.INCREASE: {
  6. console.log("INCREASE", action);
  7. return { ...state, data: state.data + 1 };
  8. }
  9. default:
  10. return state;
  11. }
  12. };