flatMap<R> method

Deferred<R> flatMap<R>(
  1. Deferred<R> f(
    1. T result
    )
)

Chains two Deferred values in sequence, using the result of callback f to determine the next value.

Implementation

Deferred<R> flatMap<R>(
  Deferred<R> Function(T result) f,
) {
  return when(
    success: (data) => f(data),
    error: (error, stackTrace) => _Error<R>(error, stackTrace),
    inProgress: () => _InProgress<R>(),
    idle: () => _Idle<R>(),
  );
}