CollectLatestFromFlow

fun <T> CollectLatestFromFlow(flow: Flow<T>, key1: Any? = null, key2: Any? = null, action: suspend (T) -> Unit)

Collect latest from flow with given action, whilst relaunching the collection upon flow, key1 or key2 changing.

See also

Flow.collectLatest