In a coroutine, a promise can be awaited (i.e. its behavior called in a suspending manner) with its await() extension function, which suspends. A coroutine context can be turned into a promise object by putting the suspending code inside a GlobalScope.promise block (or that of any other CoroutineScope). Such promises can be used by plain JavaScript code.
No comments:
Post a Comment