client/src/reducers/syncReducer.js
author ymh <ymh.work@gmail.com>
Mon, 08 Oct 2018 18:35:47 +0200
changeset 168 ea92f4fe783d
parent 130 78246db1cbac
permissions -rw-r--r--
- move SlateEditor and dependencies to its own folder - remove Immutable - remove redux-persist-immutable - remobe redux-immutable - update libraries - added tests on store manipulations (accessor and reducers)

import * as types from '../constants/actionTypes';

export const lastSync = (state = 0, action) => {
  switch (action.type) {
    case types.SYNC_SET_LAST_SYNC:
      return action.value;
    case types.AUTH_LOGOUT:
      return 0;
    default:
      return state;
  }
}

export const isSynchronizing = (state = false, action) => {
  switch (action.type) {
    case types.SYNC_START_SYNC:
      return true;
    case types.SYNC_END_SYNC:
      return false;
    default:
      return state;
  }
}