UNPKG

occsn-checkout

Version:

Occasion checkout experience boilerplate component built using React-Redux and Mitragyna

23 lines (18 loc) 758 B
import ActiveResource from 'active-resource'; import Immutable from 'immutable'; import actionTypes from '../constants/calendarConstants'; export const $$initialState = Immutable.fromJS({ activeTimeSlotsCollection: ActiveResource.CollectionResponse.build(), timeSlotsFromCalendar: ActiveResource.Collection.build(), }); export default function calendarReducer($$state = $$initialState, action) { const { type } = action; switch (type) { case actionTypes.OCCSN_SET_ACTIVE_TIME_SLOTS_COLLECTION: return $$state.merge({ activeTimeSlotsCollection: action.timeSlots }); case actionTypes.OCCSN_SET_TIME_SLOTS_FROM_CALENDAR: return $$state.merge({ timeSlotsFromCalendar: action.timeSlots }); default: return $$state; } }