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

commonMain.com.copperleaf.ballast.test.internal.vm.TestSideEffectScope.kt Maven / Gradle / Ivy

There is a newer version: 4.2.1
Show newest version
package com.copperleaf.ballast.test.internal.vm

import com.copperleaf.ballast.SideEffectScope
import kotlinx.coroutines.CompletableDeferred

internal class TestSideEffectScope(
    private val sideEffectScopeDelegate: SideEffectScope, Events, State>
) : SideEffectScope {

    override suspend fun postInput(input: Inputs) {
        val deferred = CompletableDeferred()
        sideEffectScopeDelegate.postInput(
            TestViewModel.Inputs.ProcessInput(input, deferred)
        )
        deferred.await()
    }

    override suspend fun postEvent(event: Events) {
        sideEffectScopeDelegate.postEvent(event)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy