Package-level declarations

Types

Link copied to clipboard
class FlowToStateFlow<T>(flow: Flow<T>, produceValue: () -> T) : StateFlow<T>

A subclass of StateFlow that allows us to turn a Flow into a StateFlow.

Functions

Link copied to clipboard
Link copied to clipboard
fun <T1, T2, T3> combine(flow1: Flow<T1>, flow2: Flow<T2>, flow3: Flow<T3>): Flow<Triple<T1, T2, T3>>
Link copied to clipboard
inline fun <T, R> combineAsStateFlow(flows: List<StateFlow<T>>, crossinline transform: (List<T>) -> R): StateFlow<R>

Combines a list of StateFlows into another, instead of loosening the result to a Flow.

fun <T1, T2, R> combineAsStateFlow(flow1: StateFlow<T1>, flow2: StateFlow<T2>, transform: (T1, T2) -> R): StateFlow<R>

Combines two StateFlows into another, instead of loosening the result to a Flow.

fun <T1, T2, T3, R> combineAsStateFlow(flow1: StateFlow<T1>, flow2: StateFlow<T2>, flow3: StateFlow<T3>, transform: (T1, T2, T3) -> R): StateFlow<R>

Combines three StateFlows into another, instead of loosening the result to a Flow.

fun <T1, T2, T3, T4, R> combineAsStateFlow(flow1: StateFlow<T1>, flow2: StateFlow<T2>, flow3: StateFlow<T3>, flow4: StateFlow<T4>, transform: (T1, T2, T3, T4) -> R): StateFlow<R>

Combines four StateFlows into another, instead of loosening the result to a Flow.

fun <T1, T2, T3, T4, T5, R> combineAsStateFlow(flow1: StateFlow<T1>, flow2: StateFlow<T2>, flow3: StateFlow<T3>, flow4: StateFlow<T4>, flow5: StateFlow<T5>, transform: (T1, T2, T3, T4, T5) -> R): StateFlow<R>

Combines five StateFlows into another, instead of loosening the result to a Flow.

fun <T1, T2, T3, T4, T5, T6, R> combineAsStateFlow(flow1: StateFlow<T1>, flow2: StateFlow<T2>, flow3: StateFlow<T3>, flow4: StateFlow<T4>, flow5: StateFlow<T5>, flow6: StateFlow<T6>, transform: (T1, T2, T3, T4, T5, T6) -> R): StateFlow<R>

Combines six StateFlows into another, instead of loosening the result to a Flow.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <T, R> StateFlow<T>.flatMapLatestAsStateFlow(transform: (T) -> StateFlow<R>): StateFlow<R>

Combines a list of StateFlows into another, instead of loosening the result to a Flow.

Link copied to clipboard
fun <T, R> StateFlow<T>.mapAsStateFlow(transform: (T) -> R): StateFlow<R>

Maps one StateFlow into another, instead of loosening it to a Flow.

Link copied to clipboard
fun <T> stateFlowOf(value: T): StateFlow<T>

Creates a StateFlow that only ever emits the provided value.