huridocs/uwazi

View on GitHub
app/react/Pages/reducers/uiReducer.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import Immutable from 'immutable';
import * as actions from 'app/Pages/actions/actionTypes';

export default function pagesUI(state = {}, action = {}) {
  if (action.type === actions.SAVING_PAGE) {
    return state.set('savingPage', true);
  }

  if (action.type === actions.PAGE_SAVED) {
    return state.set('savingPage', false);
  }

  return Immutable.fromJS(state);
}