Created
August 20, 2016 04:03
-
-
Save drewrawitz/231ccc56bd442dae0ce009d23cd28373 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 const updateAlert = (alert, message) => { | |
return { | |
type: 'UPDATE_ALERT', | |
alert, | |
message | |
} | |
} | |
export const updateAlertThenDelete = (alert, message) => { | |
return function (dispatch) { | |
return dispatch( | |
updateAlert(alert, message).then(() => { | |
console.log('done'); | |
}) | |
) | |
} | |
} |
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
this.props.updateAlertThenDelete('error', ERROR_MESSAGE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ddsol, you're right. I think I was overthinking this. I don't even need a callback in this instance.. all I need to do is:
Thank you for explaining everything to me, it's now starting to make sense. I appreciate it!