combineStates

fun <A, B, R> combineStates(a: StateFlow<A>, b: StateFlow<B>, transform: (A, B) -> R): StateFlow<R>

Returns a read-only StateFlow whose value combines a and b through transform.

The view is not backed by a coroutine: reading its value applies transform to the sources' current values. transform must be fast and pure.


fun <A, B, C, R> combineStates(a: StateFlow<A>, b: StateFlow<B>, c: StateFlow<C>, transform: (A, B, C) -> R): StateFlow<R>

Returns a read-only StateFlow whose value combines a, b, and c through transform.

The view is not backed by a coroutine: reading its value applies transform to the sources' current values. transform must be fast and pure.


fun <A, B, C, D, R> combineStates(a: StateFlow<A>, b: StateFlow<B>, c: StateFlow<C>, d: StateFlow<D>, transform: (A, B, C, D) -> R): StateFlow<R>

Returns a read-only StateFlow whose value combines four sources through transform.

The view is not backed by a coroutine: reading its value applies transform to the sources' current values. transform must be fast and pure.