UNPKG

shift-admin-ui-kit

Version:
20 lines (17 loc) 497 B
import * as types from "../constants/actionTypes" export const initialApiConfig = { baseEndpoint: null, headers: {} } export default function setApiConfig(state = initialApiConfig, action) { let newState = Object.assign({}, state) switch(action.type) { case types.SET_API_BASE_ENDPOINT: newState["baseEndpoint"] = action.baseEndpoint return newState case types.SET_API_HEADERS: newState["headers"] = action.headers return newState } return newState }