client/src/reducers/index.js
author ymh <ymh.work@gmail.com>
Fri, 28 Jul 2017 19:40:35 +0200
changeset 129 d48946d164c6
parent 107 e6f85e26b08c
child 134 be36eed5e6e0
permissions -rw-r--r--
Add a first version of synchronisation Remove redux-offline dependency make the redux state fully immutable TODO: better error management TODO: make syncronization work automatically

import { combineReducers } from 'redux-immutable';
import { routerReducer } from 'react-router-redux';

import notes from './notesReducer';
import { sessions } from './sessionsReducer';
import { isAuthenticated, currentUser, login, register, token, groups, createGroup, clientId } from './authReducer';
import { autoSubmit, online } from './miscReducer';
import { isSynchronizing, lastSync } from './syncReducer';


const rootReducer = combineReducers({
  sessions,
  notes,
  login,
  register,
  authStatus: combineReducers({
    token,
    currentUser,
    isAuthenticated,
    clientId,
    lastSync
  }),
  status: combineReducers({
    isSynchronizing,
    online
  }),
  router: routerReducer,
  autoSubmit,
  groups,
  createGroup,
});


export default rootReducer;