oh-my-c0de/oh-my-fullstack

View on GitHub
redux/reducers/counter.js

Summary

Maintainability
A
0 mins
Test Coverage
import { Map } from 'immutable';
import { handleActions } from 'redux-actions';
import * as actionTypes from '../actions/action-types';

const defaultState = Map({
  count: 0,
});

export default handleActions({
  [actionTypes.SET_COUNTER]: (state, { payload }) => state.set('count', payload),
}, defaultState);