commonMain.pro.respawn.flowmvi.plugins.InitPlugin.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core-jvm Show documentation
Show all versions of core-jvm Show documentation
A Kotlin Multiplatform MVI library based on plugins that is simple, fast, powerful & flexible
package pro.respawn.flowmvi.plugins
import pro.respawn.flowmvi.api.FlowMVIDSL
import pro.respawn.flowmvi.api.MVIAction
import pro.respawn.flowmvi.api.MVIIntent
import pro.respawn.flowmvi.api.MVIState
import pro.respawn.flowmvi.api.PipelineContext
import pro.respawn.flowmvi.api.StorePlugin
import pro.respawn.flowmvi.dsl.StoreBuilder
import pro.respawn.flowmvi.dsl.plugin
/**
* Installs a plugin that invokes [block] when [pro.respawn.flowmvi.api.Store.start] is called.
* @see StorePlugin.onStart
*/
@FlowMVIDSL
public fun StoreBuilder.init(
block: suspend PipelineContext.() -> Unit
): Unit = install(initPlugin(block))
/**
* Creates a plugin that invokes [block] after [pro.respawn.flowmvi.api.Store.start] is called.
* @see StorePlugin.onStart
*/
@FlowMVIDSL
public fun initPlugin(
block: suspend PipelineContext.() -> Unit,
): StorePlugin = plugin { onStart(block) }
© 2015 - 2025 Weber Informatics LLC | Privacy Policy