so in kotlin/js on the browser.. what is the easie...
# coroutines
n
so in kotlin/js on the browser.. what is the easiest way to launch a coroutines (ktor client) ? as far as i can tell there is no functions like
runBlocking
in coroutines-core-js
o
use
launch
on a
CoroutineScope
such as the
GlobalScope
, or preferably your own application-specific scope
there is no
runBlocking
because it doesn't make sense given JS's threading model (there is none).
runBlocking
implies blocking the current thread, but in JS, there is no other thread, so if your coroutines suspend inside
runBlocking
, what can resume them? where would the code continue from a suspension point?
👍 2