Created
May 15, 2018 20:14
-
-
Save p14n/1286b1098cde4e93109976360f5ecb1e to your computer and use it in GitHub Desktop.
Reducer
This file contains 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
const eventAction = (state = {}, action) => { | |
switch (action.type) { | |
... | |
case "event": | |
... | |
switch (action.name) { | |
case "created": | |
if (state.account == action.from) { | |
return { ...state, events: ev, status: "reclaimable" }; | |
} else { | |
return { ...state, events: ev, status: "payable" }; | |
} | |
case "paid": | |
return { ...state, events: ev, status: "" }; | |
... | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment