futureToPromise<T> function

Promise futureToPromise <T>(
  1. Future<T> future
)

Creates JS Promise which is resolved when future completes.

See also:

Implementation

Promise futureToPromise<T>(Future<T> future) {
  return new Promise(allowInterop((Function resolve, Function reject) {
    future.then(resolve, onError: reject);
  }));
}