Dispatcher<N extends ReduxNotifier<T> , T> class
A proxy class to provide a custom debugOrigin for dispatch.
Usage: ref.redux(myReduxProvider).dispatch(SubtractAction(2));
Constructors
- Dispatcher({required N notifier, required String debugOrigin, required LabeledReference debugOriginRef})
- Dispatcher.ofNotifier(N notifier)
-
Creates a Dispatcher from a
notifier
.
Properties
- debugOrigin → String
-
The origin of the dispatched action.
Used for debugging purposes.
Usually, the class name of the widget, provider or notifier.
final
- debugOriginRef → LabeledReference
-
The origin reference of the dispatched action.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- notifier → N
-
The notifier to dispatch actions to.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispatch(
SynchronousReduxAction< N, T, dynamic> action, {String? debugOrigin}) → T -
Dispatches an
action
to the notifier. Returns the new state. -
dispatchAsync(
AsynchronousReduxAction< N, T, dynamic> action, {String? debugOrigin}) → Future<T> - Dispatches an asynchronous action and updates the state. Returns the new state.
-
dispatchAsyncTakeResult<
R2> (BaseAsyncReduxActionWithResult< N, T, R2> action, {String? debugOrigin}) → Future<R2> - Dispatches an asynchronous action and updates the state. Returns only the result of the action.
-
dispatchAsyncWithResult<
R2> (BaseAsyncReduxActionWithResult< N, T, R2> action, {String? debugOrigin}) → Future<(T, R2)> - Dispatches an asynchronous action and updates the state. Returns the new state along with the result of the action.
-
dispatchTakeResult<
R2> (BaseReduxActionWithResult< N, T, R2> action, {String? debugOrigin}) → R2 - Dispatches an action and updates the state. Returns only the result of the action.
-
dispatchWithResult<
R2> (BaseReduxActionWithResult< N, T, R2> action, {String? debugOrigin}) → (T, R2) - Dispatches an action and updates the state. Returns the new state along with the result of the action.
-
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