ankushg
10/18/2021, 5:21 PMPromise
?turansky
10/18/2021, 5:27 PMrusshwolf
10/18/2021, 5:28 PMCoroutineScope
. Would using that and cancelling the scope meet your cancellability needs?Tomasz Krakowiak
10/18/2021, 5:30 PMGlobalScope.async {
// ...
}.asPromise()
Tomasz Krakowiak
10/18/2021, 5:31 PMankushg
10/18/2021, 6:26 PMasPromise
and .promise
! I think what we'd ideally want is some nice way to cancel the underlying scope that looks like idiomatic jS, rather than having to keep track of the Promise
and and scope the same time (similar to the way that most folks currently wrap coroutines in a suspendwrapper class for native)russhwolf
10/18/2021, 6:34 PMCoroutineScope
or a CompletableDeferred
or something in a container with whatever JS API you're looking for, but I don't know what that ishfhbd
10/18/2021, 6:43 PMankushg
10/18/2021, 7:45 PMAbortController
is the standard way to do this with fetch
but its got experimental support…