ActionBase<TResult, TState> class
Null safety
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
Properties
- cancelled → bool
-
read-only
-
cubix
→ Cubix<
TState> -
read-only
- dispatched → bool
-
read-only
- dispatcher ↔ Dispatcher
-
late, final
- done → bool
-
read-only
- error → Object?
-
retrieve error of dispatching if any. An error will be thrown when trying access this prop before dispatching
read-only
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- result → TResult?
-
retrieve action result after dispatching. An error will be thrown when trying access this prop before dispatching
read-only
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
- state ↔ TState
- retrieve current state of the cubix
- success → bool
-
read-only
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 non-existent 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 -
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