commonMain.pro.respawn.flowmvi.compose.preview.EmptyReceiver.kt Maven / Gradle / Ivy
package pro.respawn.flowmvi.compose.preview
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Immutable
import pro.respawn.flowmvi.api.IntentReceiver
import pro.respawn.flowmvi.api.MVIIntent
@Immutable
private object EmptyReceiver : IntentReceiver {
override fun intent(intent: MVIIntent): Unit = Unit
override suspend fun emit(intent: MVIIntent): Unit = Unit
}
/**
* An [IntentReceiver] that does nothing and ignores all intents. Most often used for Composable previews.
*/
@Composable
public fun EmptyReceiver(
@BuilderInference call: @Composable IntentReceiver.() -> Unit,
): Unit = call(EmptyReceiver as IntentReceiver)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy