client/src/reducers/sessionsReducer.js
changeset 59 1eb52770eefa
parent 58 f16a080e0bc4
child 62 b2514a9bcd49
equal deleted inserted replaced
58:f16a080e0bc4 59:1eb52770eefa
     1 import Immutable from 'immutable';
     1 import Immutable from 'immutable';
     2 import * as types from '../constants/actionTypes';
     2 import * as types from '../constants/actionTypes';
     3 
     3 
     4 // export const currentSession = (state = null, action) => {
     4 export const currentSession = (state = null, action) => {
     5 //   switch (action.type) {
     5   switch (action.type) {
     6 //     case types.CREATE_SESSION:
     6     case types.CREATE_SESSION:
     7 //       return action.session;
     7       return action.session;
     8 //     default:
     8     default:
     9 //       return state;
     9       return state;
    10 //   }
    10   }
    11 // };
    11 };
    12 
    12 
    13 export const sessions = (state = Immutable.List([]), action) => {
    13 export const sessions = (state = Immutable.List([]), action) => {
    14   switch (action.type) {
    14   switch (action.type) {
    15     case types.CREATE_SESSION:
    15     case types.CREATE_SESSION:
    16       return state.push(action.session);
    16       return state.push(action.session);