This very overdue release makes several major improvements to the TypeScript types, and converts the actual source to TypeScript. Sorry for the delay!
Changelog
TypeScript Improvements
This release fixes several outstanding issues that had been reported with the types. An extra overload has been added to let TS correctly understand some generically-typed values being passed to dispatch, and the overloads have been reworked for additional compatibility.
There's also a new ThunkActionDispatch type that can be used to represent how bindActionCreators turns bound thunks into (arg) => thunkReturnValue.
Additionally, all of the generic args have been giving meaningful names instead of one-letter abbreviations (S -> State, E -> ExtraArgument, etc), and we've added descriptive comments in the type definitions for clarity.
Optional Global Dispatch Type Extension
Most Redux apps have the thunk middleware enabled, but the default Dispatch and bindActionCreator types only know about the standard behavior of a basic Redux store without any middleware. The thunk middleware types add to that type behavior, so that Dispatch knows dispatching a thunk can actually return a value such as a Promise.
You can now import 'redux-thunk/extend-redux' to globally augment the Dispatch type as an opt-in change in behavior.
Codebase Converted to TypeScript
We've gone ahead and converted the actual source to TS. Since the source was only 15-ish lines to begin with, most of the "conversion" time was just trying to convince TS that assigning thunk.extraArgument = createThunkMiddleware was a legal operation :)
This version was pushed to npm by acemarke, a new releaser for redux-thunk since your current version.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot will merge this PR once CI passes on it, as requested by @mvadari.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps redux-thunk from 2.3.0 to 2.4.2.
Release notes
Sourced from redux-thunk's releases.
... (truncated)
Commits
ea2c5dd
Release 2.4.26f392f1
Merge pull request #331 from fires3as0n/fix-typo-in-readmeac9beb2
Fixed typo in README.md84128f0
Remove unused type (#328)876c893
2.4.15631c2d
Merge pull request #327 from reduxjs/feature/return-action-resolution931b5bb
Add TS 4.5 to the matrixba38cc9
README cleanupeb9ba09
Re-add explicit overload for a plain actionce76464
2.4.0Maintainer changes
This version was pushed to npm by acemarke, a new releaser for redux-thunk since your current version.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot will merge this PR once CI passes on it, as requested by @mvadari.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show