reduxjs/redux-toolkit

The official, opinionated, batteries-included toolset for efficient Redux development

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 26 minutes ago
Added to GitGenius on April 7th, 2021
Created on March 3rd, 2018
Open Issues & Pull Requests: 289 (+0)
Number of forks: 1,290
Total Stargazers: 11,224 (+0)
Total Subscribers: 70 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 15.4 hours
Mean response time: 134.5 days
90th percentile: 528.4 days
Tracked items: 743

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 77% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Work labelled "Documentation" is answered fastest, typically in under an hour, while "enhancement" waits about 21 months. 49% of tracked open issues have had no activity in three months. Only 5% of issues opened in the past year have been closed.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 207
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 770 days
Stale 30+ days: 183
Stale 90+ days: 175

Recent activity

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

Top labels

  • RTK-Query (237)
  • RTKQ-Codegen (100)
  • TypeScript (45)
  • bug (37)
  • docs (31)
  • enhancement (18)
  • question (15)
  • React-Native (13)

Detailed Description

Redux Toolkit is the official, opinionated toolset for Redux development, written in TypeScript and designed to address common pain points developers encounter when setting up and using Redux. The project was created to solve three specific problems: the complexity of configuring a Redux store, the need to install many additional packages to make Redux functional, and the amount of boilerplate code required for typical Redux implementations. Rather than attempting to solve every possible use case, Redux Toolkit deliberately limits its scope to provide abstractions over the setup process and handle the most common scenarios, following the philosophy of create-react-app.

The core Redux Toolkit package includes several key APIs that simplify Redux development. The configureStore function wraps createStore to provide simplified configuration with sensible defaults, automatically combining slice reducers, integrating supplied middleware, including redux-thunk by default, and enabling Redux DevTools Extension support. The createReducer API allows developers to define action handlers through a lookup table rather than writing switch statements, and it automatically integrates the immer library to enable writing immutable updates using normal mutative code syntax. The createAction function generates action creators from action type strings, while createSlice combines createReducer and createAction into a single API that accepts reducer functions, a slice name, and initial state to automatically generate complete slice reducers with corresponding action creators and types. Additional utilities include createAsyncThunk for handling asynchronous operations with pending, resolved, and rejected action types, createEntityAdapter for managing normalized data, createListenerMiddleware as a lightweight alternative to sagas and observables, and combineSlices for combining multiple slices with lazy loading support. The package also re-exports createSelector from the Reselect library for convenience.

RTK Query is an optional addon included within the Redux Toolkit package that addresses data fetching and caching. It provides a compact but powerful toolset for defining API interface layers, eliminating the need to hand-write data fetching and caching logic. RTK Query includes createApi as its core functionality for defining endpoints and configuring data retrieval, fetchBaseQuery as a simplified wrapper around fetch, an ApiProvider component for use without an existing Redux store, and setupListeners for enabling refetch behaviors on mount and reconnection.

The project shares contributors with microsoft/typescript, microsoft/vscode, and mui/material-ui, indicating its integration into the broader JavaScript ecosystem. Redux Toolkit is available on NPM and includes a precompiled ESM build for direct browser usage via script tags, with official templates available for Vite and Next.js projects.