Created
July 23, 2015 00:26
-
-
Save aaronjensen/b1f4f1787143c74c4363 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
function doMoneyMaking(dispatch) { | |
return apiCall() | |
.then(() => { | |
dispatch({ type: MAKE_MONEY_SUCCESS }); | |
}) | |
} | |
const actions = { | |
makeMoney() { | |
return doMoneyMaking; | |
}, | |
makeLotsOfMoney() { | |
return dispatch => doMoneyMaking(dispatch).then(() => { | |
dispatch({ type: MAKE_LOTS_OF_MONEY_SUCCESS }); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment