elemental2 icon indicating copy to clipboard operation
elemental2 copied to clipboard

how can you extract mutiple values from catch?

Open emaayan opened this issue 5 years ago • 1 comments

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

emaayan avatar Sep 29 '20 16:09 emaayan

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 avatar Jun 06 '21 10:06 zbynek