Sorry if this has been asked a million times, but ...
# coroutines
r
Sorry if this has been asked a million times, but is there a coroutines equivalent to javascript’s
Promise.all
in the standard library? Something kind of along the lines of this… but better 😛
Copy code
fun <T>all(list : List<suspend () -> T>) : Deferred<List<T>> {
    return async {
        list.map { async { it() } }
            .map { it.await() }
    }
}
short answer no
you can use a
forEach
instead of
map
if you don't care about the final result
r
Thanks for the link @spand