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

commonMain.pro.respawn.flowmvi.api.StateConsumer.kt Maven / Gradle / Ivy

Go to download

A Kotlin Multiplatform MVI library based on plugins that is simple, fast, powerful & flexible

There is a newer version: 3.0.0
Show newest version
package pro.respawn.flowmvi.api

/**
 * An entity that can [render] states coming from a [StateProvider]. Most likely, a subscriber of the [Store].
 */
public fun interface StateConsumer {

    /**
     * Render a new [state].
     * This function will be called each time a new state is received.
     *
     *  **This function must be idempotent, pure, and should not send any intents**
     *
     *  If your subscriber is stateful (such as an Android Fragment and its views), make sure to always update
     *  **all of the components (views) of the subscriber on each state change**
     */
    public fun render(state: S)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy