Edoardo Luppi
06/24/2023, 12:25 PMpublic open fun <S> then(onFulfilled: ((T) -> Promise<S>)?): Promise<S>
in KotlinJS Promise
class?
How do I workaround this limitation?Artem Kobzar
06/24/2023, 12:38 PMArtem Kobzar
06/24/2023, 12:38 PMEdoardo Luppi
06/24/2023, 12:44 PMEdoardo Luppi
06/24/2023, 12:45 PMturansky
06/24/2023, 2:03 PM// One more then
.then { it }
turansky
06/24/2023, 2:03 PMEdoardo Luppi
06/24/2023, 2:04 PMval jsPromise = promise.then {
val thenResult = thenFn(it) as JsZDeferred<S>
thenResult.promise.unsafeCast<S>()
}
Note the unsafe cast, so it doesn't complainturansky
06/24/2023, 2:06 PMthenKT***()
to detect all places after issue fixEdoardo Luppi
06/24/2023, 2:06 PMEdoardo Luppi
06/24/2023, 3:39 PMturansky
06/25/2023, 5:45 AMPromise
declaration can be updated 🙂turansky
06/25/2023, 6:35 AMEdoardo Luppi
06/25/2023, 9:28 AMturansky
06/28/2023, 10:52 PM