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

commonMain.com.harmony.kotlin.application.ui.mvi.OneShotEvent.kt Maven / Gradle / Ivy

package com.harmony.kotlin.application.ui.mvi

/**
 * Represent an event that happens one time.
 */
open class OneShotEvent(private var event: T? = null) {

  fun consume(block: (T) -> Unit) {
    event?.let(block)
    this.event = null
  }

  class Empty : OneShotEvent(null)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy