findEffect

inline fun <T : Transmission.Effect> findEffect(predicate: (T) -> Boolean): T?

Finds the first effect transmission of the specified type that matches the predicate.

Return

The first matching effect transmission, or null if none found

Example:

val navigationEffect = findEffect<NavigationEffect> { it.destination == "profile" }
assertNotNull(navigationEffect)
assertTrue(navigationEffect.clearBackStack)

Parameters

T

The type of effect to search for

predicate

Function to test each effect transmission