Spec-Zone.ru › Redux

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

© 2015–2021 Dan Abramov
Licensed under the MIT License.
https://redux.js.org/api/index.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API