UNPKG

dmx-cli

Version:

scaffold for create component, toolkit, page and so on

25 lines (21 loc) 464 B
import { FETCH_DATA, FETCH_DATA_SUCCESS } from '../actions'; const assign = Object.assign; const defaultState = { loading: false, }; function reducers(state = defaultState, action) { switch (action.type) { case FETCH_DATA: return assign({}, state, { loading: true, }); case FETCH_DATA_SUCCESS: return assign({}, state, { loading: false, ...action.payload }); default: return state; } } export default reducers;