commonMain.oolong.dispatch.util.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of oolong-metadata Show documentation
Show all versions of oolong-metadata Show documentation
MVU for Kotlin Multiplatform
The newest version!
package oolong.dispatch
import oolong.Dispatch
/**
* Contramap from [Dispatch] of [A] to [Dispatch] of [B]
*
* See: [https://oolong-kt.org/recipes/navigation/](https://oolong-kt.org/recipes/navigation/)
*/
fun contramap(dispatch: Dispatch, f: (B) -> A): Dispatch =
{ b -> dispatch(f(b)) }