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

org.hnau.base.data.maybe.MaybeIfExtensions.kt Maven / Gradle / Ivy

There is a newer version: 2.1.9
Show newest version
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