← All open source projects

Redux

reduxjs/redux

Redux is a JavaScript library for predictable global application state management.

Forks 15,058
Author reduxjs
Language TypeScript
License MIT
Synced 2026-06-27

What it is

Redux is a library for application state management. It stores data in one state tree, changes it through actions and reducers, and lets the UI subscribe to the needed state.

It became popular as React applications grew and state started spreading across components. Redux gave teams a clear contract: what happened, how data changed, and why the screen changed.

How the model works

The classic model has three pieces: a single store, an action describing an event, and a reducer that computes the next state. Modern Redux is usually written with Redux Toolkit, which removes much of the manual boilerplate.

Redux is not tied only to React, but React made it a mainstream tool.

Small Redux Toolkit slice

This example shows the modern style: state, reducers, and action creators live together without manual string action types.

Language: JavaScript
import { createSlice } from '@reduxjs/toolkit';

const counterSlice = createSlice({
  name: 'counter',
  initialState: { value: 0 },
  reducers: {
    increment(state) {
      state.value += 1;
    }
  }
});

export const { increment } = counterSlice.actions;
export default counterSlice.reducer;

What is inside

The repository contains the Redux core, documentation, examples, and material around the modern way to write Redux logic. Redux Toolkit is important because it is the recommended path for new projects.

Redux is especially valuable in debugging: action history and predictable state transitions make behavior easier to explain.

Practical context

In practice, Redux fits truly shared state: authentication, cart, editors, complex filters, or server synchronization. For a local form or a single open menu, it is usually unnecessary weight.

Strengths and limits

The main strength is explicitness. Data changes through named events, which helps testing, logging, and team discussion.

The limit is overhead for simple screens. If state is local and small, framework primitives may be enough.