We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The ThunkAction should return a function that takes dispatch (a known type of ThunkDispatch) as it's first argument:
the problem here is that dispatch() does not return a promise according to the types, but it should/does.
The text was updated successfully, but these errors were encountered:
This should work:
import { Action } from "redux"; import { ThunkAction } from "redux-thunk"; const logout = (): ThunkAction<any, any, any, Action> => dispatch => { dispatch(() => Promise.resolve()).then(); }
Also, look at the comments in #213 and #231
Redux Toolkit "Advanced Tutorial" shows a recommended approach for thunks in TS
Sorry, something went wrong.
The Redux docs "Usage with TypeScript" documents this
No branches or pull requests
The ThunkAction should return a function that takes dispatch (a known type of ThunkDispatch) as it's first argument:
the problem here is that dispatch() does not return a promise according to the types, but it should/does.
The text was updated successfully, but these errors were encountered: