google / elemental2

Type checked access to browser APIs for Java code.
Apache License 2.0
150 stars 38 forks source link

how can you extract mutiple values from catch? #151

Closed emaayan closed 1 month ago

emaayan commented 4 years ago

hi.. according to cockpit promises, the catch portion may return an additional parameter https://cockpit-project.org/guide/latest/cockpit-spawn.html from what i understand you can't have more then one value on a callback in promise

zbynek commented 3 years ago

In case it's still relevant: you can access extra arguments by calling Js.arguments(). Alternatively you can define your own class for the promise, similar to elemental2.promise.Promise, but change CatchOnRejectedCallbackFn to accept multiple arguments (since this is a difference between standard Promise and Cockpit API, it should not be part of Elemental).

zbynek commented 1 month ago

@jDramaix can this be closed as non-issue?

jDramaix commented 1 month ago

Done. Thanks for the follow-up.