Redux

Redux

  • Getting Started
  • API
  • FAQ
  • Github
  • Need help?

›API Reference

Introduction

  • Getting Started with Redux
  • Installation
  • Motivation
  • Core Concepts
  • Three Principles
  • Prior Art
  • Learning Resources
  • Ecosystem
  • Examples

Basic Tutorial

  • Basic Tutorial: Intro
  • Actions
  • Reducers
  • Store
  • Data flow
  • Usage with React
  • Example: Todo List

Advanced Tutorial

  • Advanced Tutorial: Intro
  • Async Actions
  • Async Flow
  • Middleware
  • Usage with React Router
  • Example: Reddit API
  • Next Steps

Recipes

  • Recipes: Index
  • Configuring Your Store
  • Usage With TypeScript
  • Migrating to Redux
  • Using Object Spread Operator
  • Reducing Boilerplate
  • Server Rendering
  • Writing Tests
  • Computing Derived Data
  • Implementing Undo History
  • Isolating Redux Sub-Apps
  • Using Immutable.JS with Redux
  • Code Splitting
  • Structuring Reducers

    • Structuring Reducers: Intro
    • Prerequisite Concepts
    • Basic Reducer Structure
    • Splitting Reducer Logic
    • Refactoring Reducers Example
    • Using combineReducers
    • Beyond combineReducers
    • Normalizing State Shape
    • Updating Normalized Data
    • Reusing Reducer Logic
    • Immutable Update Patterns
    • Initializing State

FAQ

  • FAQ Index
  • General
  • Reducers
  • Organizing State
  • Store Setup
  • Actions
  • Immutable Data
  • Code Structure
  • Performance
  • Design Decisions
  • React Redux
  • Miscellaneous

Other

  • Glossary
  • Troubleshooting
  • Feedback

API Reference

  • API Reference
  • createStore
  • Store
  • combineReducers
  • applyMiddleware
  • bindActionCreators
  • compose

API Reference

The Redux API surface is tiny. Redux defines a set of contracts for you to implement (such as reducers) and provides a few helper functions to tie these contracts together.

This section documents the complete Redux API. Keep in mind that Redux is only concerned with managing the state. In a real app, you'll also want to use UI bindings like react-redux.

Top-Level Exports

  • createStore(reducer, [preloadedState], [enhancer])
  • combineReducers(reducers)
  • applyMiddleware(...middlewares)
  • bindActionCreators(actionCreators, dispatch)
  • compose(...functions)

Store API

  • Store
    • getState()
    • dispatch(action)
    • subscribe(listener)
    • replaceReducer(nextReducer)

Importing

Every function described above is a top-level export. You can import any of them like this:

ES6

import { createStore } from 'redux'

ES5 (CommonJS)

var createStore = require('redux').createStore

ES5 (UMD build)

var createStore = Redux.createStore
Last updated on 8/4/2019
← FeedbackcreateStore →
Redux
Docs
Getting StartedCore ConceptsBasicsAdvanced
Community
Stack OverflowDiscord
More
GitHubStar
Copyright (c) 2015-present Dan Abramov and the Redux documentation authors.
Some icons copyright Font Awesome and Noun Project (Hassan ali, ProSymbols)