I’ve found myself using this pattern quite a lot, is there a better way (options is
Deferred<Map<String, String>
?
Copy code
options.asPromise().then { // get a value from the options map }.asDeferred()
p
Pitel
11/01/2021, 2:24 PM
I suppose you can't
await()
, because you're not in coroutine, right?
a
Alex Edwards
11/01/2021, 3:19 PM
correct. This pattern usually happens when I had something like
val setting = options['settingName']
in my code I don’t often need to add additional coroutines as the functions are usually suspend functions (lots of this code is in db service classes) and i can call