ZenithMutation<T> class

Represents the state and execution of a discrete asynchronous action.

Use mutations for user-initiated work such as saving a form, purchasing, deleting, or exporting. They retain the last successful value while a subsequent operation is pending and ignore stale results by default.

Constructors

ZenithMutation({required ZenithRef ref, required ZenithNode<AsyncValue<T>> state})
Creates a mutation that writes operation state to state.

Properties

hashCode → int
The hash code for this object.
no setterinherited
isPending → bool
Whether an execution is currently pending.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
state → ZenithNode<AsyncValue<T>>
Reactive state for the latest execution.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run(Future<T> operation()) → Future<T?>
Runs operation and returns its result when this execution remains current. A stale or disposed execution returns null; a current failed operation records AsyncError and rethrows its error to the caller.
toString() → String
A string representation of this object.
inherited

Operators

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