it seems there isn't an implementation of Promise....
# javascript
j
it seems there isn't an implementation of Promise.allSettled in KotlinJS. Does anyone know one alternative to execute an array of promises regardless of the result of the promise?
a
You can easily define it in your project with the
external
keyword.
Copy code
// FILE: missedApi.kt
@file:JsQualifier("Promise")

external fun allSettled(promises: Array<Promise<Any?>>): Promise<Array<String>>
@turansky can help you with it.
j
Ummmm! Good answers. Let me read more about the kotlin-wrappers. It could be enough.
K 2
Thanks a lot
t
Even
Promise.withResolvers
we have 🙂
j
I have achieved to sort the problem I had out. But, I was wordering if there is some advantaje to use kotlin.js.Promise (from kotlin-sdtlib-js) against js.promise.Promise (from kotlin-wrappers). What do you think about this?
t
In wrappers we use
js.promise.Promise
only
j
I have seen it, but I would like if there is some important difference between them