Sha256: 2fd815cdd72403bb162add892314a2a41b55fb19af23a4c4eb21641142ccb4fd
Contents?: true
Size: 807 Bytes
Versions: 120
Compression:
Stored size: 807 Bytes
Contents
import Immutable from 'seamless-immutable'; import { GET_ORGANIZATION_REQUEST, GET_ORGANIZATION_SUCCESS, GET_ORGANIZATION_FAILURE, SAVE_ORGANIZATION_REQUEST, SAVE_ORGANIZATION_SUCCESS, SAVE_ORGANIZATION_FAILURE, } from './OrganizationConstants'; const initialState = Immutable({ loading: false }); export default (state = initialState, action) => { switch (action.type) { case GET_ORGANIZATION_REQUEST: case SAVE_ORGANIZATION_REQUEST: return state.set('loading', true); case GET_ORGANIZATION_SUCCESS: case SAVE_ORGANIZATION_SUCCESS: { return Immutable({ loading: false, ...action.response }); } case GET_ORGANIZATION_FAILURE: case SAVE_ORGANIZATION_FAILURE: return Immutable({ error: action.error }); default: return state; } };
Version data entries
120 entries across 120 versions & 1 rubygems