Switch branches/tags
Nothing to show
Find file Copy path
768 lines (569 sloc) 35.3 KB


Reducer Utilities

Higher-Order Reducers

Related topics: Use Cases - Undo-Redo

Prebuilt Use Case Reducers

  • redux-data-structures
    Redux Data Structures is a library of higher-order functions ("reducer makers"). Reducer makers help create common reducers like counters, maps, lists (queues, stacks), sets, etc. Most application states can be built by combining a handful of these standardized building blocks.

  • common-reducers
    Prebuilt reducers for managing "applications", "messages", and JWT/"security"

  • redux-reducer-maker
    Prebuilt reducers for toggle values and request status

  • atomic-redux
    Building blocks for composing normalized collection-based state. This library cuts down on boilerplate of writing reducers and action-creators for collection-based state. The goal is to make it easier to create and work with normalized state trees.

  • redux-flag-reducer
    Create a reducer that returns true or false, "on" or "off", "loaded" or "loading", etc. Makes it convenient to implement flags as reducers in your redux state tree. This can be handy for tracking all kinds of things from toggle-based UIs to the loading/loaded state of an external resource.

  • redux-diet
    Simple pre-built reducers to handle updating objects, simple values, arrays, and request status

  • easydux
    Out of the box reducer creators for objects, arrays, and values, with customizable action types for triggering behavior.

Advanced Reducer Use Cases

Dynamic Reducer Injection

State Machines

  • redux-machine
    A tiny library for creating state machines in Redux apps. Provide an object of reducers to handle different states, and return a special key with the next state name to have the lib swap the active state reducer and include the current state name.

  • xstate
    Simple, stateless JavaScript finite state machines and statecharts. Like reducers on steroids, and can be integrated into Redux.

  • redux-dsm
    Declarative State Machines for Redux: An async state boilerplate reducer.

  • redux-state-machine
    Wraps the javascript-state-machine library for use as a Redux reducer.

  • easy-redux-fsm
    Specify action creators as a state/transition graph

  • redux-automata
    redux-automata - is a finite state machine based on Redux store. It allows developer to generate reducer automatically based on current state. The library was developed to support the following scenarios: Provide different behavoiur for the same action and avoid massive if-then-else; Ignore specific actions while in specific states (or better saying - process actions only in specific states).

  • redux-fsm
    Lightweight library for Finite State Machine support in Redux applications. This library implements FSM pattern as swappable redux reducers. In a configuration object you specify which reducer should be used for each state of FSM and actions which trigger state change.