Redux Thunk

Thunk middleware that lets Redux action creators return functions instead of plain objects

Library
npm
v3.1.0
17,661 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
46 /100 Fair
Development Activity 0
Maintenance 20
Community 64
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
83 /100 Excellent
Architecture 80
Code Quality 88
Innovation 70
Learning Curve 95

Redux Thunk is the canonical middleware for writing asynchronous and conditional logic in Redux applications. Instead of dispatching only plain action objects, it lets action creators return a function (a “thunk”) that receives dispatch, getState, and an optional injected extra argument, enabling API calls, delayed dispatches, and conditional dispatch logic to live alongside the rest of an app’s Redux code.

Maintained by the Redux core team, it ships as a single small middleware factory with full TypeScript support and is included by default in Redux Toolkit’s configureStore. Its minimal surface area — one function, one composition pattern — has made it the default recommendation for basic async side effects in Redux, with more complex flows typically graduating to Redux Saga or RTK Query only when needed.

What You Get

  • A thunk middleware export that intercepts function-type dispatches and invokes them with dispatch, getState, and an extra argument
  • A withExtraArgument() factory for injecting a custom dependency (e.g. an API client) into every thunk
  • Full TypeScript types for ThunkAction, ThunkDispatch, and ThunkMiddleware generics
  • Zero runtime dependencies beyond Redux itself
  • Automatic inclusion in Redux Toolkit’s configureStore default middleware

Common Use Cases

  • Dispatching an async action creator that performs an API call and dispatches success/failure actions
  • Conditionally dispatching an action only if certain state conditions are met
  • Injecting a mockable API service as an extra argument for easier testing of async logic
  • Composing multiple async action creators together via returned Promises for sequential control flow

Under The Hood

Architecture - The entire library is a single higher-order function (createThunkMiddleware) in src/index.ts that returns standard Redux middleware: it checks whether the dispatched action is a function, and if so calls it with (dispatch, getState, extraArgument) instead of forwarding it down the middleware chain, otherwise passing plain actions through untouched. Tech Stack - Written in TypeScript, built to dual CJS/ESM output (dist/cjs, dist/redux-thunk.mjs) via a Rollup-based build, with redux as the only peer dependency and no runtime dependencies of its own. Code Quality - Tests run via Vitest with --typecheck enabled so type-level behavior is verified alongside runtime behavior, plus ESLint and Prettier enforced through lint/format:check scripts gating prepublishOnly. API Design - The API is deliberately minimal — one named export (thunk) for the common case and one factory (withExtraArgument) for the customized case — which keeps the learning curve very low and the composition pattern (return a function, get dispatch/getState) trivial to teach.

Used by 19 apps in this directory

TypeScript
72%
AGPL 3.0

APITable

Databases · Low Code Platforms

15,623

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
71
Repo Health
77
Technical
60
Dependency
Built with
TypeScript 72%
Java 22%
Updated 3 weeks ago
TypeScript
97%
AGPL 3.0

Bigcapital

Invoicing Finance

3,916

Self-hostable double-entry accounting platform with invoicing, inventory, multi-currency, and real-time financial reporting for small and medium businesses.

View details
90
Repo Health
77
Technical
61
Dependency
Built with
TypeScript 97%
Updated 6 days ago
JavaScript
99%
Other

ChartBrew

Analytics · Databases

4,063

Open-source reporting platform to build live dashboards from SQL, NoSQL, APIs, and SaaS tools with an AI assistant that creates charts from natural language.

View details
90
Repo Health
83
Technical
64
Dependency
Built with
JavaScript 99%
Updated 1 weeks ago
TypeScript
53%
Other

Chaskiq

CRM · Customer Support

3,574

Self-hosted live chat, video calls, help center, and marketing automation — a full-stack Intercom alternative you run on your own infrastructure.

View details
57
Repo Health
66
Technical
66
Dependency
Built with
TypeScript 53%
Ruby 36%
Updated 3 months ago
Java
48%
Apache 2.0

ClearFlask

Community · Product Management

451

Open-source feedback management and roadmap tool that lets product teams collect, prioritize, and respond to user input — with AI-powered summarization and full self-hosting control.

View details
83
Repo Health
73
Technical
62
Dependency
Built with
Java 48%
TypeScript 47%
Updated 6 days ago
TypeScript
84%
Apache 2.0

Continue

AI Code Assistants · AI Development · Automation

36,049

Open-source coding agent for VS Code, JetBrains, and CLI with support for 30+ LLM providers.

View details
73
Repo Health
88
Technical
62
Dependency
Built with
TypeScript 84%
Updated 5 days ago
TypeScript
92%
MIT

GB Studio

Design Tools · Developer Tools · Game Development

9,407

Drag-and-drop retro Game Boy game creator that compiles real ROMs — no coding required.

View details
88
Repo Health
83
Technical
73
Dependency
Built with
TypeScript 92%
Updated 1 weeks ago
TypeScript
48%
AGPL 3.0

Grafana

Analytics · Monitoring

76,962

The open-source observability platform that unifies metrics, logs, and traces from any data source into dynamic, queryable dashboards.

View details
95
Repo Health
91
Technical
63
Dependency
Built with
TypeScript 48%
Go 46%
Updated 4 days ago
TypeScript
74%
Apache 2.0

Jitsi Meet

Collaboration · Team Chat · Video Conferencing

30,004

Open-source, end-to-end encrypted video conferencing you can self-host or embed into any web or mobile app.

View details
95
Repo Health
85
Technical
66
Dependency
Built with
TypeScript 74%
JavaScript 10%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers