mapAsync

suspend fun <T, R> Iterable<T>.mapAsync(mapper: suspend (T) -> R): List<R>

Asynchronously maps the elements of the iterable using the specified suspending function mapper.

Return

A list containing the results of applying the mapper function to each element.

Parameters

mapper

The suspending function to apply to each element.


suspend fun <T, R> Array<out T>.mapAsync(mapper: suspend (T) -> R): List<R>

Asynchronously maps the elements of the array using the specified suspending function mapper.

Return

A list containing the results of applying the mapper function to each element.

Parameters

mapper

The suspending function to apply to each element.