-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async / Await - Redux Thunk with a returned value #7780
Labels
Comments
You're returning function, not promise |
@goodmind I'm returning a function that returns a Promise, yes. |
@jcready Thanks, how would this work in a component context where the redux-thunk middleware handles the calling of the inner function? e.g.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Flow version:
^0.92.0
Expected behavior
No errors.
Actual behavior
Cannot call await with `checkAuthStatus()` bound to `p` because `ThunkAction` [1] is incompatible with `Promise` [2].
I'm trying to Flow type a Redux Thunk action that has a return value. I think this is related to #5294 in that I'm getting the same useless error as some of the comments although none of the workarounds posted are working for me.
I'm using the Redux Thunk example from the Flow docs (I've tried adding an explicit return type of Promise to the
ThunkAction
and async inner function):This works if I simply call
await checkAuthStatus()
, but if I try to assign the returned value (const promptSkipped = await checkAuthStatus()
), I get the above error.Try-Flow Example
I'm brand-new to Flow so hopefully there isn't a glaringly obvious problem with the way I'm trying to do this. StackOverflow question here.
The text was updated successfully, but these errors were encountered: