FluxToReduxAdapterStore<S extends InfluxStoreMixin> class

Adapts a Flux store to the interface of a Redux store.

When using an Influx architecture, this store allows Redux, Flux, and connectFlux components to stay in sync with each other.

Example:

// Declare a Flux store as normal, and mix in InfluxStoreMixin..
class ExampleStore extends Store with InfluxStoreMixin { ... }

// Instantiate your Flux actions and store as normal.
var actions = ExampleActions();
var store = ExampleStore(actions);

// Wrap them in the adapter store.
//
// Redux and `connectFlux` components should reference this store directly,
// whereas Flux components can reference the `store` instance.
var adapterStore = FluxToReduxAdapterStore(store, actions);

Related: InfluxStoreMixin

Constructors

FluxToReduxAdapterStore(S store, dynamic actions, {List<Middleware<S>>? middleware})

Properties

hashCode int
The hash code for this object.
no setterinherited
onChange Stream<S>
A stream that emits the current state when it changes.
no setterinherited
reducer ↔ Reducer<S>
The Reducer for your Store. Allows you to get the current reducer or replace it with a new one if need be.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state → S
Returns the current state of the app
no setterinherited
store → S
A reference to an instantiated Flux store object that backs the adapter store.
final

Methods

dispatch(dynamic action) → dynamic
Runs the action through all provided Middleware, then applies an action to the state using the given Reducer. Please note: Middleware can intercept actions, and can modify actions or stop them from passing through to the reducer.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
teardown() Future
Closes down the Store so it will no longer be operational. Only use this if you want to destroy the Store while your app is running. Do not use this method as a way to stop listening to onChange state changes. For that purpose, view the onChange documentation.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited