resolveMapped<R> method

FutureOr<R> resolveMapped<R>(
  1. FutureOr<R> mapper(
    1. T val
    )
)

Resolves this instance mapping to mapper and return its result.

Implementation

FutureOr<R> resolveMapped<R>(FutureOr<R> Function(T val) mapper) {
  var self = this;

  if (self is Future<T>) {
    return self.then(mapper);
  } else {
    return mapper(self);
  }
}