TestLoop

class TestLoop(model: TestModel, renderer: Renderer<TestState, TestModel>, args: TestArgs? = null, onStart: ActionEmitter<TestModel, TestDependency>.() -> Unit = {}, dependency: TestDependency? = null, effectContext: CoroutineContext = DispatcherProvider.IO) : Loop<TestState, TestModel, TestArgs, TestDependency, TestAction>

Loop used in library tests.

Constructors

Link copied to clipboard
constructor(model: TestModel, renderer: Renderer<TestState, TestModel>, args: TestArgs? = null, onStart: ActionEmitter<TestModel, TestDependency>.() -> Unit = {}, dependency: TestDependency? = null, effectContext: CoroutineContext = DispatcherProvider.IO)

Properties

Link copied to clipboard

The first state of this com.ekezet.hurok.Loop in a blocking fashion. Useful for testing.

Link copied to clipboard
val state: Flow<TestState>

The current state produced by this loop

Functions

Link copied to clipboard

Apply new arguments to this loop.

Link copied to clipboard

Attach this loop as a child to another loop.

Link copied to clipboard
override fun emit(action: Action<TestModel, TestDependency>)

Emit an action to change the state or trigger an effect.

Link copied to clipboard
fun startIn(scope: CoroutineScope): Job

Start the loop in the given scope.