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

commonMain.ControllerStateInit.kt Maven / Gradle / Ivy

package kt.mobius

class ControllerStateInit(
    private val actions: ControllerActions,
    private var nextModelToStartFrom: M
) : ControllerStateBase() {

    override val stateName: String
        get() = "init"

    override fun onConnect(view: Connectable) {
        actions.goToStateCreated(view, nextModelToStartFrom)
    }

    override fun onReplaceModel(model: M) {
        nextModelToStartFrom = model
    }

    override fun onGetModel(): M {
        return nextModelToStartFrom
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy