promise<T extends JSAny?> function

JSPromise<T> promise<T extends JSAny?>(
  1. Future<T> function()
)

Create a JSPromise from a Dart function that returns a Future

Implementation

JSPromise<T> promise<T extends JSAny?>(
  Future<T> Function() function,
) =>
    function().toJS;