Robert Menke
04/17/2018, 1:39 PMPromise.all
in the standard library?
Something kind of along the lines of this… but better 😛
fun <T>all(list : List<suspend () -> T>) : Deferred<List<T>> {
return async {
list.map { async { it() } }
.map { it.await() }
}
}
Daniel Tam
04/17/2018, 1:45 PMforEach
instead of map
if you don't care about the final resultspand
04/17/2018, 2:18 PMRobert Menke
04/17/2018, 6:15 PM