Static extension class for additional JavaScript-style methods.
The class is intended to be used using the using
keyword.
Static methods
staticall<T>(promises:Iterable<Promise<T>>):Promise<Array<T>>
Returns a promise that is fulfilled when all the given promises are fulfilled or rejected with a reason of the first promise that is rejected.
staticallSettled<T>(promises:Iterable<Promise<T>>):Promise<Array<SettledOutcome<T>>>
Returns a promise that will be fulfilled with an array of outcome objects when all of the given promises are settled.
The object will have fields:
status
(String
) either "fulfilled" or "rejected"value
(T
) whenstatus
is "fulfilled"reason
whenstatus
is "rejected"
If the method is not implemented on the JS target, use
-D thenshim_js_fallback_allSettled
to enable a fallback implementation.
Objects are either FulfilledOutcome
or RejectedOutcome
, but using
reflection (Reflect
) instead of casting is recommended for
cross-target compatibility.
staticcatch_<T, R>(promise:Promise<T>, onRejected:ThenableCallback<Any, Null<R>>):Promise<Null<R>>
Calls then
with the onRejected
callback.