Last active
July 29, 2018 16:16
-
-
Save monday8am/52c76962e0281b25a60b081f5004aad5 to your computer and use it in GitHub Desktop.
Async seudo code call
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
if state.needsAsyncData { | |
dispatch(LoadingAction) | |
asyncCall() | |
.whenOk { dispatch(OkAction(result) } | |
.whenError { dispatch(ErrorAction(error)) } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment