expectStateOn

inline suspend fun <LAST_STATE : STATE> expectStateOn(expectedChange: LAST_STATE.() -> STATE)(source)

Awaits for a state and checks if it matches the expected state change from the previous state, ensuring the last state is of the expected type.

Parameters

expectedChange

The expected change from the previous state.

Throws

if state does not match the expected change.