ActionBase<TResult, TState> class abstract

This is base class for action. An action is where to put logic to process individual task. The action supports sync/async logic

Implementers

Constructors

ActionBase()

Properties

cancelled bool
is action dispatching cancelled
no setter
cubix Cubix<TState>
no setter
dispatched bool
no setter
dispatcher Dispatcher
latefinal
done bool
no setter
error Object?
retrieve error of dispatching if any. An error will be thrown when trying access this prop before dispatching
no setter
hashCode int
The hash code for this object.
no setterinherited
result → TResult?
retrieve action result after dispatching. An error will be thrown when trying access this prop before dispatching
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state ↔ TState
retrieve current state of the cubix
getter/setter pair
success bool
no setter

Methods

all<TKey>(Map<TKey, Object?> awatiable) Future<Map<TKey, Object?>>
allSettled<TKey>(Map<TKey, Object?> awatiable) Future<Map<TKey, Object?>>
body() → TResult
cancel() → void
canDispatch(Cubix cubix) bool
dispatch<TActionResult>(ActionBase<TActionResult, TState> action, {CancelToken? cancelToken}) → TActionResult
dispose() → void
inject(DependencyResolver resolver) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
on({VoidCallback? done, VoidCallback? success, VoidCallback? dispose, void error(Object)?}) → void
onBind(Dispatcher dispatcher) → void
onDispatch() → void
onDispose() → void
onDone() → void
onError(Object error) → void
onInit() → void
onSuccess() → void
race<TKey>(Map<TKey, Object?> awatiable) Future<Map<TKey, Object?>>
resolve<T extends IDependency>(T create(), {Object? family}) → T
selfDispatch(Cubix<TState> cubix, {CancelToken? cancelToken}) → void
dispatch this action with specified cubix
toString() String
A string representation of this object.
inherited
wait() Future<Object?>
wait until action dispatching is completed
watch(List<Cubix> cubixes) Future<void>
watch changes of cubixes, unlikely cubix.watch(), this method returns a future object that is completed when given cubixes are changed
when(bool predicate(Object action), {Cubix? cubix}) Future<Object>
this method returns a future object that is completed when the dispatching action is satisfied the given predicate

Operators

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