Redux Thunk

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

Library
npm
v3.1.0
17,656 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
98%
Other

Kibana

Analytics · Monitoring

21,338

Your open source window into the Elastic Stack — query, visualize, and act on data stored in Elasticsearch with real-time dashboards, AI-assisted search, and automated alerting.

View details
98
Repo Health
87
Technical
63
Dependency
Built with
TypeScript 98%
Updated 5 days ago
TypeScript
94%
AGPL 3.0

Laudspeaker

Automation · Marketing

2,629

Open-source customer engagement platform for building visual, event-triggered messaging journeys across email, SMS, push, in-app, and webhooks.

View details
45
Repo Health
66
Technical
62
Dependency
Built with
TypeScript 94%
Updated 3 months ago
TypeScript
51%
Other

Mattermost

Collaboration · Devops · Team Chat

39,418

Open core, self-hosted team collaboration with chat, AI agents, voice calling, and deep DevOps integrations — all under your control.

View details
96
Repo Health
87
Technical
65
Dependency
Built with
TypeScript 51%
Go 40%
Updated 5 days ago
Python
58%
Apache 2.0

MLflow

AI Development · Monitoring

28,512

The open source AI engineering platform for debugging, evaluating, monitoring, and optimizing production LLMs and agents at scale.

View details
96
Repo Health
86
Technical
67
Dependency
Built with
Python 58%
TypeScript 35%
Updated 5 days ago
Go
52%
Apache 2.0

opencloud

File Storage

6,218

Open source file management and collaboration platform that keeps your data under your control, no database required.

View details
86
Repo Health
80
Technical
68
Dependency
Built with
Go 52%
Gherkin 33%
PHP 11%
Updated 6 days ago
JavaScript
50%
AGPL 3.0

QRev

AI Agents · CRM

364

Open source AI-first sales platform that replaces Salesforce with autonomous agents handling prospecting, outreach, and lead management at scale.

View details
39
Repo Health
68
Technical
64
Dependency
Built with
JavaScript 50%
Python 28%
TypeScript 14%
Updated 8 months ago
TypeScript
97%
AGPL 3.0

Responsively App

Design Tools · Developer Tools

25,464

Preview and interact with your responsive web design across every device size simultaneously — no more manual resizing.

View details
79
Repo Health
71
Technical
66
Dependency
Built with
TypeScript 97%
Updated 3 weeks ago
TypeScript
50%
Other

SigNoz

Analytics · Monitoring

32,429

Self-host your entire observability stack — logs, metrics, traces, and LLM monitoring — in one OpenTelemetry-native platform, without the Datadog bill.

View details
92
Repo Health
83
Technical
64
Dependency
Built with
TypeScript 50%
Go 38%
Updated 6 days ago
JavaScript
74%
AGPL 3.0

Twake Drive

Collaboration · File Storage

989

Open-source, self-hosted file manager with collaborative drives, AI-powered summarization, and OnlyOffice document editing for teams who want full data sovereignty.

View details
91
Repo Health
78
Technical
71
Dependency
Built with
JavaScript 74%
TypeScript 25%
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