{"full_name":"reduxjs/redux-thunk","owner":"reduxjs","name":"redux-thunk","shard":"1","url":"https://github.com/reduxjs/redux-thunk","description":"Thunk middleware for Redux","homepage":null,"topics":[],"tag_pages":[],"language":"TypeScript","license":"MIT","avatar":"https://avatars.githubusercontent.com/u/13142323?v=4","created_at":"2015-07-13T13:33:08Z","pushed_at":"2025-03-16T00:36:10Z","metrics":{"stars":17654,"forks":1014,"watchers":163,"issues":217,"prs":148,"releases":20,"issues_open":2,"issues_closed":215,"prs_open":1,"prs_closed":61,"prs_merged":86,"discussions":3},"growth":{"day":{"stars":0,"forks":-1,"base_day":"2026-11-15"}},"history":{"dates":["2026-11-10","2026-11-11","2026-11-12","2026-11-13","2026-11-14","2026-11-15","2026-11-16"],"stars":[17653,17654,17655,17655,17655,17654,17654],"forks":[1015,1015,1015,1015,1015,1015,1014],"watchers":[null,163,163,163,163,163,163],"issues_open":[null,2,2,2,2,2,2],"prs_open":[null,1,1,1,1,1,1]},"boards":{},"same_owner":[{"full_name":"reduxjs/redux","name":"redux","shard":"1","boards":{}},{"full_name":"reduxjs/reselect","name":"reselect","shard":"1","boards":{}}],"issues":[{"number":380,"title":"Release redux-thunk 4.0 as a re-export of `redux`","comments":0,"created_at":"2026-11-01T07:38:43Z"},{"number":379,"title":"build: migrate build setup to `tsdown`","comments":0,"created_at":"2026-06-06T11:15:15Z"}],"discussions":[{"number":358,"title":"v3.0.0","comments":0,"category":"General","created_at":"2023-12-04T13:56:24Z"},{"number":325,"title":"v2.4.0","comments":0,"category":"General","created_at":"2021-10-26T01:19:05Z"},{"number":310,"title":"Passing `dispatch` instead of calling it.","comments":0,"category":"Q&A","created_at":"2021-02-02T14:42:10Z"}],"latest_release":{"name":"v3.1.0","tag":"v3.1.0","published_at":"2023-12-04T13:57:13Z","body":"This **major release**:\r\n\r\n- Updates the packaging for better ESM/CJS compatibility\r\n- Changes the package to use named exports instead of a default export\r\n\r\nThis release has **breaking changes**.  (Note: this actually points to v3.1.0, which includes a hotfix that was meant for 3.0.0.)\r\n\r\nThis release is part of a wave of major versions of all the Redux packages: **Redux Toolkit 2.0, Redux core 5.0, React-Redux 9.0, Reselect 5.0, and Redux Thunk 3.0**.\r\n\r\nFor full details on all of the breaking changes and other significant changes to all of those packages, see the **[\"Migrating to RTK 2.0 and Redux 5.0\" migration guide](https://redux.js.org/usage/migrations/migrating-rtk-2)** in the Redux docs.\r\n\r\n> [!NOTE] \r\n> The Redux core, Reselect, and Redux Thunk packages are included as part of Redux Toolkit, and RTK users do not need to manually upgrade them - you'll get them as part of the upgrade to RTK 2.0.  (If you're not using Redux Toolkit yet, [**please start migrating your existing legacy Redux code to use Redux Toolkit today!**](https://redux.js.org/usage/migrating-to-modern-redux))\r\n\r\n```bash\r\n# RTK\r\nnpm install @reduxjs/toolkit\r\nyarn add @reduxjs/toolkit\r\n\r\n# Standalone\r\nnpm install redux-thunk\r\nyarn add redux-thunk\r\n```\r\n\r\n## Changelog\r\n\r\n### Named Exports Instead of Default Exports\r\n\r\nThe `redux-thunk` package previously used a single default export that was the thunk middleware, with an attached field named `withExtraArgument` that allowed customization.\r\n\r\n**The default export has been removed. There are now two named exports: `thunk` (the basic middleware) and `withExtraArgument`.**\r\n\r\nIf you are using Redux Toolkit, this should have no effect, as RTK already handles this inside of `configureStore`.\r\n\r\n### ESM/CJS Package Compatibility\r\n\r\nThe biggest theme of the Redux v5 and RTK 2.0 releases is trying to get \"true\" ESM package publishing compatibility in place, while still supporting CJS in the published package.\r\n\r\n**The primary build artifact is now an ESM file, `dist/redux-thunk.mjs`**.  Most build tools should pick this up.  There's also a CJS artifact, and a second copy of the ESM file named `redux-thunk.legacy-esm.js` to support Webpack 4 (which does not recognize the `exports` field in `package.json`).\r\n\r\n#### Build Tooling\r\n\r\nWe're now building the package using https://github.com/egoist/tsup. We also now include sourcemaps for the ESM and CJS artifacts.\r\n\r\nThe repo has been updated to use Yarn 3 for dependencies and Vitest for running tests.\r\n\r\n#### Dropping UMD Builds\r\n\r\nRedux has always shipped with UMD build artifacts.  These are primarily meant for direct import as script tags, such as in a CodePen or a no-bundler build environment.\r\n\r\nFor now, we're dropping those build artifacts from the published package, on the grounds that the use cases seem pretty rare today.\r\n\r\nSince the code is so simple, the ESM artifact can be used directly in the browser via Unpkg.\r\n\r\nIf you have strong use cases for us continuing to include UMD build artifacts, please let us know!\r\n\r\n### `extend-redux` Typedefs Removed\r\n\r\nRedux Thunk 2.x included a `redux-thunk/extend-redux` TS-only entry point, which extended the types of `dispatch` and `bindActionCreators` to globally give them knowledge of the thunk types.  We feel that global overrides from a library are an anti-pattern, and we've removed this entry point.  (_Note_: this ended up being released in 3.1.0, as it was missed in the original 3.0.0 release.)\r\n\r\nPlease follow our [TS setup guidelines](https://redux.js.org/tutorials/typescript-quick-start#define-root-state-and-dispatch-types) to infer the correct type of `dispatch` for your store.\r\n\r\n## What's Changed\r\n\r\n* Migrate thunk package to ESM by @markerikson in https://github.com/reduxjs/redux-thunk/pull/340\r\n* Switch package manager to Yarn 3 and update CI jobs by @markerikson in https://github.com/reduxjs/redux-thunk/pull/341\r\n* Run RTK publish CI examples on built artifact by @markerikson in https://github.com/reduxj","is_prerelease":false},"readme":true,"readme_zh":false,"news":[],"stale":false,"snapshot_at":"2026-11-16T09:23:14Z","history_start":"2026-09-06"}