We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In the unit tests for promises we find:
private static Value wrapPromise(Context context, CompletableFuture<String> javaFuture) { Value global = context.getBindings("js"); Value promiseConstructor = global.getMember("Promise"); return promiseConstructor.newInstance((ProxyExecutable) arguments -> { Value resolve = arguments[0]; Value reject = arguments[1]; javaFuture.whenComplete((result, ex) -> { if (result != null) { resolve.execute(result); } else { reject.execute(ex); } }); // return value of function(resolve,reject) is ignored by `new Promise()`. return null; }); } public interface Thenable { void then(Value onResolve, Value onReject); }
These look useful! It'd be great if these conversions were done automatically, rather than being a bit of utility code.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In the unit tests for promises we find:
These look useful! It'd be great if these conversions were done automatically, rather than being a bit of utility code.
The text was updated successfully, but these errors were encountered: