map

inline fun <T : Any, R : Any> Data<T>.map(coroutineContext: CoroutineContext = EmptyCoroutineContext, meta: Meta = this.meta, crossinline block: suspend (T) -> R): Data<R>

Lazily transform this data to another data. By convention block should not use external data (be pure).

Parameters

coroutineContext

additional CoroutineContext elements used for data computation.

meta

for the resulting data. By default equals input data.

block

the transformation itself

suspend fun <T : Any, R : Any> DataSet<T>.map(outputType: KType, coroutineContext: CoroutineContext = EmptyCoroutineContext, metaTransform: MutableMeta.() -> Unit = {}, block: suspend (T) -> R): DataTree<R>
inline suspend fun <T : Any, R : Any> DataSet<T>.map(coroutineContext: CoroutineContext = EmptyCoroutineContext, noinline metaTransform: MutableMeta.() -> Unit = {}, noinline block: suspend (T) -> R): DataTree<R>