UpdatableMx<T> mixin
添加update方法, 自动捕获异常
- Superclass constraints
- Mixin applications
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
slowly
→ Slowly<
Object> -
no setterinherited
-
stream
→ Stream<
T> -
get value's stream
no setterinherited
- value → T
-
get current value
no setterinherited
Methods
-
debounceMs<
R> (Object tag, R func, {int ms = 200}) → Future< R?> -
inherited
-
dispose(
) → void -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
put(
T value) → T -
put new value
inherited
-
putError(
Object error, [StackTrace? stackTrace]) → void -
put new error
inherited
-
runCatching<
R> (FutureOr< R> block(), {FutureOr<R?> onSuccess(R data)?, FutureOr<R?> onFailure(Object e, StackTrace s)?, dynamic ignoreSkipError = true}) → FutureOr<R?> -
ignoreSkipError
true: SkipError will not triggeronFailure
when trueinherited -
skp(
String msg) → SkipError -
SkipError
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
FutureOr< T> update(T old), {dynamic onError(Object e, StackTrace s)?, int slowlyMs = 100, Object? debounceTag, Object? throttleTag}) → Future<void> - 执行一个异步操作, 并更新状态 不建议对本方法进行二次包装, 因此返回值强制为 void
-
updateRaw(
FutureOr< T?> update(T old), {dynamic onError(Object e, StackTrace s)?, int slowlyMs = 100, Object? debounceTag, Object? throttleTag, dynamic ignoreSkipError = true}) → FutureOr<T?> -
for advance user
you can sync update value, and get the return value
update
if return value, will callput
if return null, will not callput
/putError
onError
if set null,will callputError
if set function value, will not callputError
, you can invokeputError
manuallyslowlyMs
if set <=0 value, will ignore debounce/throttleTagdebounceTag
enable debounce, require unique within the VM scopethrottleTag
enable throttle, require unique within the VM scopeignoreSkipError
refrunCatching.ignoreSkipError
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited