Sha256: 2b4e082ce946bbaf8bb2a9d8045cf4f59a8ca948dbee14140b05102fd7f0a782
Contents?: true
Size: 862 Bytes
Versions: 123
Compression:
Stored size: 862 Bytes
Contents
import Immutable from 'seamless-immutable'; import { GET_ORGANIZATIONS_LIST_SUCCESS, GET_ORGANIZATIONS_LIST_REQUEST, GET_ORGANIZATIONS_LIST_FAILURE, CHANGE_CURRENT_ORGANIZATION_SUCCESS, } from '../../redux/consts'; const initialState = Immutable({ loading: false }); export default (state = initialState, action) => { const { payload } = action; switch (action.type) { case GET_ORGANIZATIONS_LIST_REQUEST: return state.set('loading', true); case GET_ORGANIZATIONS_LIST_SUCCESS: return state .set('list', payload.results) .set('loading', false); case CHANGE_CURRENT_ORGANIZATION_SUCCESS: return state .set('currentId', payload) .set('loading', false); case GET_ORGANIZATIONS_LIST_FAILURE: return state .set('error', payload); default: return state; } };
Version data entries
123 entries across 123 versions & 1 rubygems