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

Reducers

Reducer Utilities

Higher-Order Reducers

Related topics: Use Cases - Undo-Redo

Prebuilt Use Case Reducers

  • redux-data-structures
    https://github.com/adrienjt/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
    https://github.com/luispablo/common-reducers
    Prebuilt reducers for managing "applications", "messages", and JWT/"security"

  • redux-reducer-maker
    https://github.com/grifo/redux-reducer-maker
    Prebuilt reducers for toggle values and request status

  • atomic-redux
    https://github.com/brietsparks/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
    https://github.com/DannyDelott/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
    https://github.com/AlexMouton/redux-diet
    Simple pre-built reducers to handle updating objects, simple values, arrays, and request status

  • easydux
    https://github.com/gtg092x/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
    https://github.com/mheiber/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
    https://github.com/davidkpiano/xstate
    Simple, stateless JavaScript finite state machines and statecharts. Like reducers on steroids, and can be integrated into Redux.

  • redux-dsm
    https://github.com/ericelliott/redux-dsm
    Declarative State Machines for Redux: An async state boilerplate reducer.

  • redux-state-machine
    https://github.com/realb0t/redux-state-machine
    Wraps the javascript-state-machine library for use as a Redux reducer.

  • easy-redux-fsm
    https://github.com/andrewosh/easy-redux-fsm
    Specify action creators as a state/transition graph

  • redux-automata
    https://github.com/mocoding-software/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
    https://github.com/quadreex/fsm-redux
    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.