redux-thunk
by
reduxjs

Description: Thunk middleware for Redux

View on GitHub ↗

Summary Information

Updated 20 minutes ago
Added to GitGenius on April 7th, 2021
Created on July 13th, 2015
Open Issues & Pull Requests: 2 (+0)
Number of forks: 1,019
Total Stargazers: 17,693 (+0)
Total Subscribers: 164 (+0)

Issue Activity (beta)

Open issues: 1
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 0 days
Stale 30+ days: 1
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • Maintenance (1)
  • Tooling (1)

Most active issues this week

No issue events were indexed in the last 7 days.

Repository Insights (GitGenius)

Median issue/PR response: 1.1 hours
Mean response time: 1.4 hours
90th percentile: 2.9 hours
Tracked items: 3

Most active contributors

Detailed Description

Redux Thunk is a middleware package for Redux that enables writing action creators as functions containing logic that can interact with a Redux store's dispatch and getState methods. Written in TypeScript, it solves a fundamental limitation of plain Redux stores, which can only perform simple synchronous updates by default. By allowing asynchronous operations and complex conditional logic, Redux Thunk extends the store's capabilities to handle side effects like API calls and delayed dispatches.

The middleware works by allowing action creators to return functions instead of plain action objects. These functions, called thunks, receive dispatch and getState as parameters, enabling them to perform asynchronous operations and conditionally dispatch actions based on store state. This approach is particularly useful for basic Redux side effects logic, including complex synchronous operations that need store access and simple async logic such as AJAX requests. The package is written as a named export and can be applied using Redux's applyMiddleware function for manual setup, though Redux Toolkit's configureStore API includes it by default.

Since version 2.1.0, Redux Thunk supports injecting custom arguments into the middleware, typically useful for swapping API service layers or other dependencies in testing environments. The withExtraArgument function generates the correct thunk middleware when setting up stores manually. Return values from inner functions are available as dispatch return values, enabling orchestration of asynchronous control flow where thunk action creators can dispatch each other and return Promises to wait for completion.

The repository maintains active development with a median issue and pull request response latency of 1.1 hours and a mean latency of 1.4 hours across tracked items. GitGenius activity tracking shows EskiMojo14 as the most active contributor with 5 events, followed by aryaemami59 with 3 events and chpio with 1 event. The most active issue labels tracked are Tooling and Maintenance, each with 1 event. The repository is classified across multiple domains including async operations, functional programming, state management, middleware, and asynchronous actions, reflecting its core purpose in the Redux ecosystem.

Redux Thunk maintains strong connections within the Redux ecosystem, with overlapping contributors linking it to related repositories including redux-toolkit, react-redux, and the core redux package. While not directly included in the Redux core library, it serves as the default async middleware in the official Redux Toolkit package, making it a foundational tool for Redux applications. The project is licensed under the MIT license and provides comprehensive documentation through the official Redux docs on Writing Logic with Thunks, along with numerous community resources explaining thunk concepts and usage patterns.

redux-thunk
by
reduxjsreduxjs/redux-thunk

Repository Details

Fetching additional details & charts...