org.hnau.emitter.extensions.coerce.EmitterCoerceAtMostExtensions.kt Maven / Gradle / Ivy
package org.hnau.emitter.extensions.coerce
import org.hnau.emitter.Emitter
import org.hnau.emitter.extensions.map
import org.hnau.emitter.observing.push.lateinit.combine
fun > Emitter.coerceAtMost(maximumValue: Emitter) =
Emitter.combine(this, maximumValue) { first, second -> first.coerceAtMost(second) }
fun > Emitter.coerceAtMost(maximumValue: T) =
map { it.coerceAtMost(maximumValue) }
fun > T.coerceAtMost(maximumValue: Emitter) =
maximumValue.map { this.coerceAtMost(it) }
© 2015 - 2025 Weber Informatics LLC | Privacy Policy