victorpopkov/universal-redux

View on GitHub
src/app/event/loading/duck/reducers.js

Summary

Maintainability
A
0 mins
Test Coverage
import { createReducer } from 'redux-immutablejs';
import { fromJS } from 'immutable';
import types from './types';

export default createReducer(
  fromJS({
    shown: false,
  }),
  {
    [types.NOTIFY_PROGRESS_SHOW]: (state) =>
      state.merge({
        shown: true,
      }),
    [types.NOTIFY_PROGRESS_HIDE]: (state) =>
      state.merge({
        shown: false,
      }),
  },
);