Confused about Promises or otherwise suspended functions
Hey, i got a function that requests a json file from a server, which i figured out how to do in a blocking way thanks to coroutines.
Im now in the situation where id like to have it assigned directly in a class, but thats obviously outside of any coroutine scope.
Is it not possible to directly do that?
Like:
class Test {
val test = download("/test.json")
}
From what i can tell in pure javascript i could return a Promise and then await it, but the await function in Kotlin/js uses Coroutines,...