Ecosystem
Redux is a tiny library, but its contracts and APIs are carefully chosen to spawn an ecosystem of tools and extensions, and the community has created a wide variety of helpful addons, libraries, and tools. You don't need to use any of these addons to use Redux, but they can help make it easier to implement features and solve problems in your application.
For an extensive catalog of libraries, addons, and tools related to Redux, check out the Redux Ecosystem Links list. Also, the React/Redux Links list contains tutorials and other useful resources for anyone learning React or Redux.
This page lists some of the Redux-related addons that the Redux maintainers have vetted personally, or that have shown widespread adoption in the community. Don't let this discourage you from trying the rest of them! The ecosystem is growing too fast, and we have a limited time to look at everything. Consider these the “staff picks”, and don't hesitate to submit a PR if you've built something wonderful with Redux.
Table of Contents
- Library Integration and Bindings
- Reducers
- Actions
- Utilities
- Store
- Immutable Data
- Side Effects
- Middleware
- Entities and Collections
- Component State and Encapsulation
- Dev Tools
- Testing
- Routing
- Forms
- Higher-Level Abstractions
- Community Conventions
Library Integration and Bindings
reduxjs/react-reduxThe official React bindings for Redux, maintained by the Redux team
angular-redux/ng-reduxAngular 1 bindings for Redux
angular-redux/storeAngular 2+ bindings for Redux
ember-redux/ember-reduxEmber bindings for Redux
glimmer-redux/glimmer-reduxRedux bindings for Ember's Glimmer component engine
tur-nr/polymer-reduxRedux bindings for Polymer
lastmjs/redux-store-elementRedux bindings for custom elements
Reducers
Reducer Combination
ryo33/combineSectionReducersAn expanded version of combineReducers
, which allows passing state
as a third argument to all slice reducers.
KodersLab/topologically-combine-reducersA combineReducers
variation that allows defining cross-slice dependencies for ordering and data passing
var masterReducer = topologicallyCombineReducers(
{ auth, users, todos },
// define the dependency tree
{ auth: ['users'], todos: ['auth'] }
)
Reducer Composition
acdlite/reduce-reducersProvides sequential composition of reducers at the same level
const combinedReducer = combineReducers({ users, posts, comments })
const rootReducer = reduceReducers(combinedReducer, otherTopLevelFeatureReducer)
mhelmer/redux-xformsA collection of composable reducer transformers
const createByFilter = (predicate, mapActionToKey) =>
compose(
withInitialState({}), // inject initial state as {}
withFilter(predicate), // let through if action has filterName
updateSlice(mapActionToKey), // update a single key in the state
isolateSlice(mapActionToKey) // run the reducer on a single state slice
)
adrienjt/redux-data-structuresReducer factory functions for common data structures: counters, maps, lists (queues, stacks), sets
const myCounter = counter({
incrementActionTypes: ['INCREMENT'],
decrementActionTypes: ['DECREMENT']
})
Higher-Order Reducers
omnidan/redux-undoEffortless undo/redo and action history for your reducers
omnidan/redux-ignoreIgnore redux actions by array or filter function
omnidan/redux-recycleReset the redux state on certain actions
ForbesLindesay/redux-optimistA reducer enhancer to enable type-agnostic optimistic updates
Actions
reduxactions/redux-actionsFlux Standard Action utilities for Redux
const increment = createAction('INCREMENT')
const reducer = handleActions({ [increment]: (state, action) => state + 1 }, 0)
const store = createStore(reducer)
store.dispatch(increment())
BerkeleyTrue/redux-create-typesCreates standard and async action types based on namespaces
export const types = createTypes(
['openModal', createAsyncTypes('fetch')],
'app'
)
// { openModal : "app.openModal", fetch : { start : "app.fetch.start", complete: 'app.fetch.complete' } }
maxhallinan/kreighterGenerates action creators based on types and expected fields
const formatTitle = (id, title) => ({
id,
title: toTitleCase(title)
})
const updateBazTitle = fromType('UPDATE_BAZ_TITLE', formatTitle)
updateBazTitle(1, 'foo bar baz')
// -> { type: 'UPDATE_BAZ_TITLE', id: 1, title: 'Foo Bar Baz', }
Utilities
reduxjs/reselectCreates composable memoized selector functions for efficiently deriving data from the store state
const taxSelector = createSelector(
[subtotalSelector, taxPercentSelector],
(subtotal, taxPercent) => subtotal * (taxPercent / 100)
)
paularmstrong/normalizrNormalizes nested JSON according to a schema
const user = new schema.Entity('users')
const comment = new schema.Entity('comments', { commenter: user })
const article = new schema.Entity('articles', {
author: user,
comments: [comment]
})
const normalizedData = normalize(originalData, article)
planttheidea/selectoratorAbstractions over Reselect for common selector use cases
const getBarBaz = createSelector(
['foo.bar', 'baz'],
(bar, baz) => `${bar} ${baz}`
)
getBarBaz({ foo: { bar: 'a' }, baz: 'b' }) // "a b"
Store
Change Subscriptions
jprichardson/redux-watchWatch for state changes based on key paths or selectors
let w = watch(() => mySelector(store.getState()))
store.subscribe(
w((newVal, oldVal) => {
console.log(newval, oldVal)
})
)
ashaffer/redux-subscribeCentralized subscriptions to state changes based on paths
store.dispatch( subscribe("users.byId.abcd", "subscription1", () => {} );
Batching
tappleby/redux-batched-subscribeStore enhancer that can debounce subscription notifications
const debounceNotify = _.debounce(notify => notify())
const store = createStore(
reducer,
initialState,
batchedSubscribe(debounceNotify)
)
manaflair/redux-batchStore enhancer that allows dispatching arrays of actions
const store = createStore(reducer, reduxBatch)
store.dispatch([{ type: 'INCREMENT' }, { type: 'INCREMENT' }])
laysent/redux-batch-actions-enhancerStore enhancer that accepts batched actions
const store = createStore(reducer, initialState, batch().enhancer)
store.dispatch(createAction({ type: 'INCREMENT' }, { type: 'INCREMENT' }))
tshelburne/redux-batched-actionsHigher-order reducer that handles batched actions
const store = createStore(enableBatching(reducer), initialState)
store.dispatch(batchActions([{ type: 'INCREMENT' }, { type: 'INCREMENT' }]))
Persistence
rt2zz/redux-persistPersist and rehydrate a Redux store, with many extensible options
const store = createStore(reducer, autoRehydrate())
persistStore(store)
react-stack/redux-storagePersistence layer for Redux with flexible backends
const reducer = storage.reducer(combineReducers(reducers))
const engine = createEngineLocalStorage('my-save-key')
const storageMiddleware = storage.createMiddleware(engine)
const store = createStore(reducer, applyMiddleware(storageMiddleware))
redux-offline/redux-offlinePersistent store for Offline-First apps, with support for optimistic UIs
const store = createStore(reducer, offline(offlineConfig))
store.dispatch({
type: 'FOLLOW_USER_REQUEST',
meta: { offline: { effect: {}, commit: {}, rollback: {} } }
})
Immutable Data
Data Structures
facebook/immutable-jsImmutable persistent data collections for Javascript
const map1 = Map({ a: 1, b: 2, c: 3 })
const map2 = map1.set('b', 50)
map1.get('b') // 2
map2.get('b') // 50
rtfeldman/seamless-immutableFrozen immutable arrays/objects, backwards-compatible with JS
const array = Immutable(['totally', 'immutable', { a: 42 }])
array[0] = 'edited' // does nothing
planttheidea/crioImmutable JS objects with a natural API
const foo = crio(['foo'])
const fooBar = foo.push('bar') // new array: ['foo', 'bar']
aearly/icepickUtilities for treating frozen JS objects as persistent immutable collections.
const newObj = icepick.assocIn({ c: { d: 'bar' } }, ['c', 'd'], 'baz')
const obj3 = icepicke.merge(obj1, obj2)
Immutable Update Utilities
mweststrate/immerImmutable updates with normal mutative code, using Proxies
const nextState = produce(baseState, draftState => {
draftState.push({ todo: 'Tweet about it' })
draftState[1].done = true
})
kolodny/immutability-helperA drop-in replacement for react-addons-update
const newData = update(myData, {
x: { y: { z: { $set: 7 } } },
a: { b: { $push: [9] } }
})
mariocasciaro/object-path-immutableSimpler alternative to immutability-helpers and Immutable.js
const newObj = immutable(obj)
.set('a.b', 'f')
.del(['a', 'c', 0])
.value()
debitoor/dot-prop-immutableImmutable version of the dot-prop lib, with some extensions
const newState = dotProp.set(state, `todos.${index}.complete`, true)
const endOfArray = dotProp.get(obj, 'foo.$end')
Immutable/Redux Interop
gajus/redux-immutablecombineReducers equivalent that works with Immutable.js Maps
const initialState = Immutable.Map()
const rootReducer = combineReducers({})
const store = createStore(rootReducer, initialState)
eadmundo/redux-seamless-immutablecombineReducers equivalent that works with seamless-immutable values
import { combineReducers } from 'redux-seamless-immutable';
const rootReducer = combineReducers({ userReducer, posts
Side Effects
Widely Used
gaearon/redux-thunkDispatch functions, which are called and given dispatch
and getState
as parameters. This acts as a loophole for AJAX calls and other async behavior.
Best for: getting started, simple async and complex synchronous logic.
function fetchData(someValue) {
return (dispatch, getState) => {
dispatch({type : "REQUEST_STARTED"});
myAjaxLib.post("/someEndpoint", {data : someValue})
.then(response => dispatch({type : "REQUEST_SUCCEEDED", payload : response})
.catch(error => dispatch({type : "REQUEST_FAILED", error : error});
};
}
function addTodosIfAllowed(todoText) {
return (dispatch, getState) => {
const state = getState();
if(state.todos.length < MAX_TODOS) {
dispatch({type : "ADD_TODO", text : todoText});
}
}
}
redux-saga/redux-sagaHandle async logic using synchronous-looking generator functions. Sagas return descriptions of effects, which are executed by the saga middleware, and act like "background threads" for JS applications.
Best for: complex async logic, decoupled workflows
function* fetchData(action) {
const { someValue } = action
try {
const response = yield call(myAjaxLib.post, '/someEndpoint', {
data: someValue
})
yield put({ type: 'REQUEST_SUCCEEDED', payload: response })
} catch (error) {
yield put({ type: 'REQUEST_FAILED', error: error })
}
}
function* addTodosIfAllowed(action) {
const { todoText } = action
const todos = yield select(state => state.todos)
if (todos.length < MAX_TODOS) {
yield put({ type: 'ADD_TODO', text: todoText })
}
}
redux-observable/redux-observable
Handle async logic using RxJS observable chains called "epics".Compose and cancel async actions to create side effects and more.
Best for: complex async logic, decoupled workflows
const loginRequestEpic = action$ =>
action$
.ofType(LOGIN_REQUEST)
.mergeMap(({ payload: { username, password } }) =>
Observable.from(postLogin(username, password))
.map(loginSuccess)
.catch(loginFailure)
)
const loginSuccessfulEpic = action$ =>
action$
.ofType(LOGIN_SUCCESS)
.delay(2000)
.mergeMap(({ payload: { msg } }) => showMessage(msg))
const rootEpic = combineEpics(loginRequestEpic, loginSuccessfulEpic)
A port of the Elm Architecture to Redux that allows you to sequence your effects naturally and purely by returning them from your reducers. Reducers now return both a state value and a side effect description.
Best for: trying to be as much like Elm as possible in Redux+JS
export const reducer = (state = {}, action) => {
switch (action.type) {
case ActionType.LOGIN_REQUEST:
const { username, password } = action.payload
return loop(
{ pending: true },
Effect.promise(loginPromise, username, password)
)
case ActionType.LOGIN_SUCCESS:
const { user, msg } = action.payload
return loop(
{ pending: false, user },
Effect.promise(delayMessagePromise, msg, 2000)
)
case ActionType.LOGIN_FAILURE:
return { pending: false, err: action.payload }
default:
return state
}
}
Side effects lib built with observables, but allows use of callbacks, promises, async/await, or observables. Provides declarative processing of actions.
Best for: very decoupled async logic
const loginLogic = createLogic({
type: Actions.LOGIN_REQUEST,
process({ getState, action }, dispatch, done) {
const { username, password } = action.payload
postLogin(username, password)
.then(
({ user, msg }) => {
dispatch(loginSucceeded(user))
setTimeout(() => dispatch(showMessage(msg)), 2000)
},
err => dispatch(loginFailure(err))
)
.then(done)
}
})
Promises
acdlite/redux-promiseDispatch promises as action payloads, and have FSA-compliant actions dispatched as the promise resolves or rejects.
dispatch({ type: 'FETCH_DATA', payload: myAjaxLib.get('/data') })
// will dispatch either {type : "FETCH_DATA", payload : response} if resolved,
// or dispatch {type : "FETCH_DATA", payload : error, error : true} if rejected
lelandrichardson/redux-packSensible, declarative, convention-based promise handling that guides users in a good direction without exposing the full power of dispatch.
dispatch({type : "FETCH_DATA", payload : myAjaxLib.get("/data") });
// in a reducer:
case "FETCH_DATA": =
return handle(state, action, {
start: prevState => ({
...prevState,
isLoading: true,
fooError: null
}),
finish: prevState => ({ ...prevState, isLoading: false }),
failure: prevState => ({ ...prevState, fooError: payload }),
success: prevState => ({ ...prevState, foo: payload }),
});
Middleware
Networks and Sockets
svrcekmichal/redux-axios-middlewareFetches data with Axios and dispatches start/success/fail actions
export const loadCategories() => ({ type: 'LOAD', payload: { request : { url: '/categories'} } });
agraboso/redux-api-middlewareReads API call actions, fetches, and dispatches FSAs
const fetchUsers = () => ({
[CALL_API]: {
endpoint: 'http://www.example.com/api/users',
method: 'GET',
types: ['REQUEST', 'SUCCESS', 'FAILURE']
}
})
itaylor/redux-socket.ioAn opinionated connector between socket.io and redux.
const store = createStore(reducer, applyMiddleware(socketIoMiddleware))
store.dispatch({ type: 'server/hello', data: 'Hello!' })
tiberiuc/redux-react-firebaseIntegration between Firebase, React, and Redux
Async Behavior
rt2zz/redux-action-bufferBuffers all actions into a queue until a breaker condition is met, at which point the queue is released
wyze/redux-debounceFSA-compliant middleware for Redux to debounce actions.
mathieudutour/redux-queue-offlineQueue actions when offline and dispatch them when getting back online.
Analytics
rangle/redux-beaconIntegrates with any analytics services, can track while offline, and decouples analytics logic from app logic
hyperlab/redux-insightsAnalytics and tracking with an easy API for writing your own adapters
markdalgleish/redux-analyticsWatches for Flux Standard Actions with meta analytics values and processes them
Entities and Collections
tommikaikkonen/redux-ormA simple immutable ORM to manage relational data in your Redux store.
Versent/redux-crudConvention-based actions and reducers for CRUD logic
kwelch/entities-reducerA higher-order reducer that handles data from Normalizr
amplitude/redux-queryDeclare colocated data dependencies with your components, run queries when components mount, perform optimistic updates, and trigger server changes with Redux actions.
cantierecreativo/redux-beesDeclarative JSON-API interaction that normalizes data, with a React HOC that can run queries
GetAmbassador/redux-clerkAsync CRUD handling with normalization, optimistic updates, sync/async action creators, selectors, and an extendable reducer.
shoutem/redux-ioJSON-API abstraction with async CRUD, normalization, optimistic updates, caching, data status, and error handling.
jmeas/redux-resourceA tiny but powerful system for managing 'resources': data that is persisted to remote servers.
Component State and Encapsulation
tonyhb/redux-ui"Block-level scoping" for UI state. Decorated components declare data fields, which become props and can be updated by nested children.
@ui({
key: 'some-name',
state: { uiVar1: '', uiVar2: (props, state) => state.someValue },
reducer: (state, action) => {}
})
class YourComponent extends React.Component {}
threepointone/redux-react-localLocal component state in Redux, with handling for component actions
@local({
ident: 'counter', initial: 0, reducer : (state, action) => action.me ? state + 1 : state }
})
class Counter extends React.Component {
epeli/lean-reduxMakes component state in Redux as easy as setState
const DynamicCounters = connectLean(
scope: "dynamicCounters",
getInitialState() => ({counterCount : 1}),
addCounter, removeCounter
)(CounterList);
ioof-holdings/redux-subspaceCreates isolated "sub-stores" for decoupled micro front-ends, with integration for React, sagas, and observables
const reducer = combineReducers({
subApp1: namespaced('subApp1')(counter),
subApp2: namespaced('subApp2')(counter)
})
const subApp1Store = subspace(state => state.subApp1, 'subApp1')(store)
const subApp2Store = subspace(state => state.subApp2, 'subApp2')(store)
subApp1Store.dispatch({ type: 'INCREMENT' })
console.log('store state:', store.getState()) // { "subApp1": { value: 2 }, "subApp2": { value: 1 } }
DataDog/redux-doghouseAims to make reusable components easier to build with Redux by scoping actions and reducers to a particular instance of a component.
const scopeableActions = new ScopedActionFactory(actionCreators)
const actionCreatorsScopedToA = scopeableActions.scope('a')
actionCreatorsScopedToA.foo('bar') //{ type: SET_FOO, value: 'bar', scopeID: 'a' }
const boundScopeableActions = bindScopedActionFactories(
scopeableActions,
store.dispatch
)
const scopedReducers = scopeReducers(reducers)
Dev Tools
Debuggers and Viewers
Dan Abramov's original Redux DevTools implementation, built for in-app display of state and time-travel debugging
zalmoxisus/redux-devtools-extension
Mihail Diordiev's browser extension, which bundles multiple state monitor views and adds integration with the browser's own dev tools
A cross-platform Electron app for inspecting React and React Native apps, including app state, API requests, perf, errors, sagas, and action dispatching.
DevTools Monitors
Log MonitorThe default monitor for Redux DevTools with a tree view
Dock MonitorA resizable and movable dock for Redux DevTools monitors
Slider MonitorA custom monitor for Redux DevTools to replay recorded Redux actions
InspectorA custom monitor for Redux DevTools that lets you filter actions, inspect diffs, and pin deep paths in the state to observe their changes
Diff MonitorA monitor for Redux DevTools that diffs the Redux store mutations between actions
Filterable Log MonitorFilterable tree view monitor for Redux DevTools
Chart MonitorA chart monitor for Redux DevTools
Filter ActionsRedux DevTools composable monitor with the ability to filter actions
Logging
evgenyrodionov/redux-loggerLogging middleware that shows actions, states, and diffs
inakianduaga/redux-state-historyEnhancer that provides time-travel and efficient action recording capabilities, including import/export of action logs and action playback.
joshwcomeau/redux-vcrRecord and replay user sessions in real-time
socialtables/redux-unhandled-actionWarns about actions that produced no state changes in development
Mutation Detection
leoasis/redux-immutable-state-invariantMiddleware that throws an error when you try to mutate your state either inside a dispatch or between dispatches.
flexport/mutation-sentinelHelps you deeply detect mutations at runtime and enforce immutability in your codebase.
mmahalwy/redux-pure-connectCheck and log whether react-redux's connect method is passed mapState
functions that create impure props.
Testing
arnaudbenard/redux-mock-storeA mock store that saves dispatched actions in an array for assertions
Workable/redux-test-beltExtends the store API to make it easier assert, isolate, and manipulate the store
conorhastings/redux-test-recorderMiddleware to automatically generate reducers tests based on actions in the app
wix/redux-testkitComplete and opinionated testkit for testing Redux projects (reducers, selectors, actions, thunks)
jfairbank/redux-saga-test-planMakes integration and unit testing of sagas a breeze
Routing
supasate/connected-react-routerSynchronize React Router 4 state with your Redux store.
FormidableLabs/redux-little-routerA tiny router for Redux applications that lets the URL do the talking
faceyspacey/redux-first-routerSeamless Redux-first routing. Think of your app in states, not routes, not components, while keeping the address bar in sync. Everything is state. Connect your components and just dispatch flux standard actions.
Forms
erikras/redux-formA full-featured library to enable a React HTML form to store its state in Redux.
davidkpiano/react-redux-formReact Redux Form is a collection of reducer creators and action creators that make implementing even the most complex and custom forms with React and Redux simple and performant.
Higher-Level Abstractions
keajs/keaAn abstraction over Redux, Redux-Saga and Reselect. Provides a framework for your app’s actions, reducers, selectors and sagas. It empowers Redux, making it as simple to use as setState. It reduces boilerplate and redundancy, while retaining composability.
jumpsuit/jumpstateA simplified layer over Redux. No action creators or explicit dispatching, with a built-in simple side effects system.
TheComfyChair/redux-sccTakes a defined structure and uses 'behaviors' to create a set of actions, reducer responses and selectors.
Bloomca/redux-tilesProvides minimal abstraction on top of Redux, to allow easy composability, easy async requests, and sane testability.
Community Conventions
Flux Standard ActionA human-friendly standard for Flux action objects
Canonical Reducer CompositionAn opinionated standard for nested reducer composition
Ducks: Redux Reducer BundlesA proposal for bundling reducers, action types and actions