Last active
April 2, 2018 20:45
-
-
Save Ayyagaries/a25ba98e9b2b32e3d3c4f6cbef5ba4dc to your computer and use it in GitHub Desktop.
reducer with REQUEST_ATTACHED_ENTITIES_STARTED
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
RESPONSE_ADMIN_ATTACHED_FACILITIES, | |
ERROR, | |
REQUEST_ATTACHED_ENTITIES_STARTED, | |
} from '../actions/pickFacility'; | |
const initialState = { | |
attachedFacilities: [], | |
msg: false, | |
isLoading: true, | |
}; | |
export default (state = initialState, action) => { | |
switch (action.type) { | |
case RESPONSE_ADMIN_ATTACHED_FACILITIES: | |
return { | |
...state, | |
attachedFacilities: action.attachedFacilities, | |
msg: false, | |
isLoading: false, | |
}; | |
case ERROR: | |
return { | |
...state, | |
msg: true, | |
attachedFacilities: [], | |
isLoading: false, | |
}; | |
case REQUEST_ATTACHED_ENTITIES_STARTED: | |
return { | |
...state, | |
}; | |
default: { | |
return state; | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment