Created
November 26, 2016 20:45
-
-
Save kieran/f9c9fda62d22d9f6aaaa8672c21ef80d 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
module.exports = | |
eventsLoading: (state=false, action)-> | |
params = _.omit action, 'type' | |
switch action.type | |
when 'GET_EVENTS' | |
true | |
when 'RECEIVE_EVENTS' | |
false | |
else | |
state | |
events: (state=[], action)-> | |
params = _.omit action, 'type' | |
switch action.type | |
when 'RECEIVE_EVENTS' | |
params.events | |
else | |
state | |
selectedEvent: (state=null, action)-> | |
params = _.omit action, 'type' | |
switch action.type | |
when 'GET_EVENTS' | |
null | |
when 'RECEIVE_EVENTS' | |
params.events?[0] | |
when 'SELECT_EVENT' | |
params.event | |
else | |
state |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment