All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hnau.emitter.extensions.EmitterReduceExtensions.kt Maven / Gradle / Ivy

There is a newer version: 2.1.3
Show newest version
package org.hnau.emitter.extensions

import org.hnau.emitter.Emitter
import org.hnau.emitter.observing.push.always.line


inline fun  Iterable>.reduce(
        crossinline operation: (accumulator: S?, item: T?) -> S
) = line { it.reduce(operation) }

inline fun  Iterable>.reduceIndexed(
        crossinline operation: (index: Int, accumulator: S?, item: T?) -> S
) = line { it.reduceIndexed(operation) }

inline fun  Iterable>.reduceRight(
        crossinline operation: (item: T?, accumulator: S?) -> S
) = line { it.reduceRight(operation) }

inline fun  Iterable>.reduceRightIndexed(
        crossinline operation: (index: Int, item: T?, accumulator: S?) -> S
) = line { it.reduceRightIndexed(operation) }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy