Created
October 2, 2017 18:17
-
-
Save shotaK/af8c5f3c348cbab2e75fcd322bc2e00c to your computer and use it in GitHub Desktop.
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
export default function reducer(state=initialState, action) { | |
switch(action.type) { | |
case defs.MAKE_PAYMENT_SUCCESS: | |
return state.withMutations(s => | |
s.set('modalOpen', false) | |
.set('loading', false) | |
.setIn(['loans', action.loan.id], Immutable.fromJS(action.loan)) | |
) | |
case defs.MAKE_PAYMENT_FAILED: | |
return state.withMutations(s => | |
s.set('modalOpen', false) | |
.set('loading', false) | |
.set('paymentError', action.error) | |
) | |
// ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment