reduceToData

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

Lazily reduce a collection of Data to a single data.

fun <K, T : Any, R : Any> Map<K, Data<T>>.reduceToData(outputType: KType, coroutineContext: CoroutineContext = EmptyCoroutineContext, meta: Meta = Meta.EMPTY, block: suspend (Map<K, T>) -> R): Data<R>
inline suspend fun <T : Any, R : Any> Flow<NamedData<T>>.reduceToData(coroutineContext: CoroutineContext = EmptyCoroutineContext, meta: Meta = Meta.EMPTY, noinline transformation: suspend (Flow<NamedData<T>>) -> R): Data<R>
inline suspend fun <T : Any, R : Any> DataSet<T>.reduceToData(coroutineContext: CoroutineContext = EmptyCoroutineContext, meta: Meta = Meta.EMPTY, noinline transformation: suspend (Flow<NamedData<T>>) -> R): Data<R>
inline fun <K, T : Any, R : Any> Map<K, Data<T>>.reduceToData(coroutineContext: CoroutineContext = EmptyCoroutineContext, meta: Meta = Meta.EMPTY, noinline block: suspend (Map<K, T>) -> R): Data<R>

Lazily reduce a Map of Data with any static key.

Parameters

K

type of the map key

T

type of the input goal

R

type of the result goal

suspend fun <T : Any, R : Any> Flow<NamedData<T>>.reduceToData(outputType: KType, coroutineContext: CoroutineContext = EmptyCoroutineContext, meta: Meta = Meta.EMPTY, transformation: suspend (Flow<NamedData<T>>) -> R): Data<R>

Transform a Flow of NamedData to a single Data.