andThenAsync<U extends Object> method

Future<TaskResult<U, E>> andThenAsync<U extends Object>(
  1. FutureOr<TaskResult<U, E>> op(
    1. T data
    )
)

This is the async version of andThen.

Implementation

Future<TaskResult<U, E>> andThenAsync<U extends Object>(FutureOr<TaskResult<U, E>> Function(T data) op) async {
  if (isOk) {
    return await op(data!);
  }
  return Err(error!);
}