ifAsync method

  1. @override
Async<T> ifAsync(
  1. @noFutures void noFutures(
    1. Async<T> self,
    2. Async<T> async
    )
)
override

Performs a side-effect if this is Async.

Implementation

@override
@pragma('vm:prefer-inline')
Async<T> ifAsync(
  @noFutures void Function(Async<T> self, Async<T> async) noFutures,
) {
  return Sync(() {
    noFutures(this, this);
    return this;
  }).flatten().toAsync();
}