You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some examples in the readme. I'd happily accept a PR if you have something to add 🙂.
As for async stuff: usually you would first pick a Redux middleware for it, like redux-saga, or redux-thunk, or redux-promise. Then either dispatch async actions manually before and after an async process, or introduce a helper that wraps these processes. There are already packages that integrate typescript-fsa with redux-saga or redux-thunk.
From the code you posted I'd guess that it's using redux-promise or similar. Make sure that the middleware is applied to the store. It should augment the type of store.dispatch.
It would be nice to have an examples folder with a real redux app with all the various ways this can be used and best practices, Esp async stuff.
My use case is that I'm trying to understand a codebase I've inherited and am not sure if this is a standard practice or not:
loadSites() is passed to an argument to store.dispatch and is giving me typing errors:
TypeScript error: Argument of type '(dispatch: Dispatch<AnyAction>) => Promise<Site[]>' is not assignable to parameter of type 'AnyAction'.
The text was updated successfully, but these errors were encountered: