withJsValuesAsync<T> function
Keeps tracked handles alive until the asynchronous operation completes.
Implementation
Future<T> withJsValuesAsync<T>(
Future<T> Function(JsValueScope scope) operation) async {
final scope = JsValueScope();
try {
return await operation(scope);
} finally {
scope.dispose();
}
}