Expand description

A predictable reactive framework for Rust apps.

Overview

Reducer is inspired by the Flux pattern, popular in the JavaScript community as an effective idiom to build scalable and maintainable apps.

The core mental model behind Reducer is the unidirectional data flow depicted below.

               Reducer               |
+------------------------------------|-----------------+
|                                    |                 |
|    ----------        ---------     |      --------   |
+--> | Action | -----> | State | --- | ---> | View | --+
     ----------        ---------     |      --------
                                     |

The view, often a [G]UI, dispatches actions on the store, which in turn updates its internal state and notifies back the view.

Optional Features

  • alloc (enabled by default)

    Controls whether crate alloc is linked.

  • std (enabled by default; implies alloc)

    Controls whether crate std is linked.

  • async (enabled by default; implies std)

    Enables integration with futures-rs.

Structs

An adapter for [Sink]s that behaves as an asynchronous Dispatcher (requires async).

An adapter for [Sink]s that behaves as an asynchronous Reactor (requires async).

A reactive state container.

Enums

The error returned when dispatching an action to a spawned Store fails (requires async).

Traits

Trait for types that allow dispatching actions.

Trait for types that react to state transitions.

Trait for types that represent the logical state of an application.