Store<State extends Built<State, StateBuilder> , StateBuilder extends Builder<State, StateBuilder> , Actions extends ReduxActions> class
Store is the container of your state. It listens for actions, invokes reducers, and publishes changes to the state
Constructors
-
Store.new(Reducer<
State, StateBuilder, dynamic> reducer, State defaultState, Actions actions, {Iterable<Middleware< middleware = const []})State, StateBuilder, Actions> >
Properties
- actions → Actions
-
actions returns the synced actions
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
nextState
→ Stream<
State> -
nextState is a stream which has a payload of the next state value, rather than the StoreChange event
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → State
-
state returns the current state
no setter
-
stream
→ Stream<
StoreChange< State, StateBuilder, dynamic> > -
subscribe
returns a stream that will be dispatched whenever the state changesno setter
Methods
-
actionStream<
Payload> (ActionName< Payload> actionName) → Stream<StoreChange< State, StateBuilder, Payload> > - actionStream returns a stream the fires when a state change is caused by the action with the name provided. Check out built_redux_rx if you are looking for streams to actions that do not necessarily result in state changes.
-
dispose(
) → Future< Null> - dispose removes closes both the dispatch and subscription stream
-
nextSubstate<
Substate> (StateMapper< State, StateBuilder, Substate> mapper) → Stream<Substate> - nextSubstate is a stream which has a payload of the next subState value, rather than the SubstateChange event
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
replaceState(
State state) → void - replaceState replaces the state of your store. Useful for undo/redo, testing, and development tools
-
substateStream<
Substate> (StateMapper< State, StateBuilder, Substate> mapper) → Stream<SubstateChange< Substate> > - substateStream returns a stream to the state that is returned by the mapper function. For example: say my state object had a property count, then store.substateStream((state) => state.count), would return a stream that fires whenever count changes.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited