update method

Future<void> update(
  1. FutureOr<T> update(
    1. T old
    ), {
  2. dynamic onError(
    1. Object e,
    2. StackTrace s
    )?,
  3. int slowlyMs = 100,
  4. Object? debounceTag,
  5. Object? throttleTag,
})

执行一个异步操作, 并更新状态 不建议对本方法进行二次包装, 因此返回值强制为 void

Implementation

Future<void> update(
  FutureOr<T> Function(T old) update, {
  Function(Object e, StackTrace s)? onError,
  int slowlyMs = 100,
  Object? debounceTag,
  Object? throttleTag,
}) async => await updateRaw(
  (old) => update(old),
  onError: onError,
  slowlyMs: slowlyMs,
  debounceTag: debounceTag,
  throttleTag: throttleTag,
);