org.hnau.base.data.maybe.MaybeIfExtensions.kt Maven / Gradle / Ivy
package org.hnau.base.data.maybe
import org.hnau.base.extensions.it
inline fun Maybe.ifSuccess(action: (T) -> R) = checkMaybe(action, { null })
inline fun Maybe.ifError(action: (Throwable) -> R) = checkMaybe({ null }, action)
fun Maybe.takeIfSuccess() = ifSuccess(::it)
fun Maybe.takeIfError() = ifError(::it)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy