This releases fixes our dev UMD build, and improves type inference for dispatch
based on provided middleware.
Changes
Dispatch and Middleware Typings
The Redux core types will modify the type of dispatch
based on provided middleware, allowing it to accept parameters other than action objects and return other values. The redux-thunk
middleware is an example of this.
RTK's configureStore
and getDefaultMiddleware
were not correctly picking up the types of the middleware, and were always assuming that redux-thunk
was enabled at the type level even if the thunk middleware had been disabled.
This has been fixed, and the store should now correctly pick up the types of both the default and user-provided middleware.
Additional Type Re-Exports
RTK now re-exports the ThunkAction
type from redux-thunk
, and the Draft
type from immer
.
Dev UMD fixes
Our dev UMD build was broken due to the recent build configuration changes, and that has now been fixed. This means the sandbox in the Basic Tutorial should be working again.