Why there is no ```public open fun <S> then(...
# javascript
e
Why there is no
Copy code
public open fun <S> then(onFulfilled: ((T) -> Promise<S>)?): Promise<S>
in KotlinJS
Promise
class? How do I workaround this limitation?
a
There is a method inside Kotlin/JS Promise class
e
@Artem Kobzar ahhh, you mean that one?
otherwise I'm not understanding
t
WA:
Copy code
// One more then
.then { it }
There is related issue on YouTrack
e
@turansky thanks! I had settled for:
Copy code
val jsPromise = promise.then {
  val thenResult = thenFn(it) as JsZDeferred<S>
  thenResult.promise.unsafeCast<S>()
}
Note the unsafe cast, so it doesn't complain
t
We had extension
thenKT***()
to detect all places after issue fix
e
That's a good idea, I'll wrap it too
@turansky ticket is https://youtrack.jetbrains.com/issue/KT-19672 btw, just found it
t
Looks like
Promise
declaration can be updated 🙂
e
@turansky worth mentioning in the ticket itself?
t
Action required before