commonMain.net.humans.kmm.mvi.ReduxEngine.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mvi-core Show documentation
Show all versions of mvi-core Show documentation
Simple and concise implementation of Redux/MVI approach by Humans.
The newest version!
package net.humans.kmm.mvi
import kotlinx.coroutines.channels.SendChannel
import kotlinx.coroutines.flow.StateFlow
/**
* MVI Engine
*/
class ReduxEngine(
val input: SendChannel,
val output: StateFlow,
) {
fun send(msg: M) {
input.trySend(msg).isSuccess
}
}