Created
May 16, 2018 15:44
-
-
Save Ayyagaries/e0d0638b64f57ce32e3174daa51c9d48 to your computer and use it in GitHub Desktop.
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_REPS_CURRENTLY_CHECKED_IN, | |
RESPONSE_NEGATIVE_EVENTS, | |
SHOWLOADING, | |
REQUEST_NEGATIVE_EVENTS, | |
REQUEST_REPS_CURRENTLY_CHECKED_IN | |
} from "../actions/homescreen"; | |
const initialState = { | |
reps_currently_checkedIn: [], | |
negative_events_for_facility: [], | |
showLoading: false | |
}; | |
export default (state = initialState, action) => { | |
switch (action.type) { | |
case REQUEST_REPS_CURRENTLY_CHECKED_IN: { | |
return { | |
...state, | |
reps_currently_checkedIn: [] | |
}; | |
} | |
case REQUEST_NEGATIVE_EVENTS: { | |
return { | |
...state, | |
negative_events_for_facility: [] | |
}; | |
} | |
case RESPONSE_REPS_CURRENTLY_CHECKED_IN: { | |
return { | |
...state, | |
reps_currently_checkedIn: action.reps_currently_checkedIn | |
}; | |
} | |
case RESPONSE_NEGATIVE_EVENTS: { | |
return { | |
...state, | |
negative_events_for_facility: action.negative_events_for_facility | |
}; | |
} | |
case SHOWLOADING: { | |
return { | |
...state, | |
showLoading: action.showLoading | |
}; | |
} | |
default: | |
return state; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment