Store<S extends StoreState> class

Creates a store that holds the app's state.

The only way to change the state in the store is to dispatch an action. The action will be sent to the provided Reducer to update the state.

Only after a new state is computed will the dispatched action be added to the stream of actions that is provided to each Effect.

Constructors

Store({required S initialState, Reducer<S>? reducer, List<Effect<S>>? effects})

Properties

effects List<Effect<S>>?
A list of effects to be run after a new state is computed.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
reducer Reducer<S>?
A function that takes a StoreAction and a State, and returns a new State.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state → BehaviorSubject<S>
The store's state.
final
value → S
The current value of the state in the store.
no setter

Methods

dispatch(StoreAction action) → dynamic
Dispatch a new action.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
select<R, P>(Selector<S, R> selector, [dynamic props]) Stream<R>
Stream the state of the of the store given a Selector.
toString() String
A string representation of this object.
inherited

Operators

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