WareContext<S> class

The context in which a middleware or afterware function executes.

In a manner similar to the streaming architecture used for reducers, Store offers each Bloc the chance to apply middleware and afterware functionality to incoming Actions by listening to the "dispatch" stream, which is of type Stream<WareContext<S>>.

Middleware and afterware functions can examine the incoming action and current state of the app and perform side effects (including dispatching new Actions using dispatcher. Afterward, they should emit a new WareContext for the next Bloc.

Constructors

WareContext(DispatchFunction dispatcher, S state, Action action)
const

Properties

action Action
final
dispatcher DispatchFunction
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state → S
final

Methods

copyWith(Action newAction) WareContext<S>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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