fromFuture static method

JSPromise fromFuture(
  1. Future future
)

Implementation

static JSPromise fromFuture(Future<dynamic> future) {
  return JSPromise((List funcs) {
    final resolve = funcs[0];
    final reject = funcs[1];
    future.then((v) => resolve(v)).catchError((e) => reject(e));
  });
}