Package-level declarations

Types

Link copied to clipboard
interface StateHolder<State>

A container for managing state.

Link copied to clipboard
interface StateOwner<State>

Exposes a state property that can be used to access the state of a StateHolder.

Link copied to clipboard
fun interface StateProvider<State>

A provider of a state for a StateHolder.

Functions

Link copied to clipboard
Link copied to clipboard

Convenience function to create a StateProvider from any T value.

Link copied to clipboard
fun <T, State> Flow<T>.collectToState(container: StateHolder<State>, scope: CoroutineScope, block: suspend (state: State, value: T) -> State): Job
Link copied to clipboard

Convenience function to create a simple StateProvider with a value.

Convenience function to create a lazily evaluated StateProvider.

Link copied to clipboard
fun <State> stateContainer(initialState: State): StateHolder<State>

Create a StateHolder with the given initialState.

fun <State> stateContainer(initialStateProvider: StateProvider<State>): StateHolder<State>

Create a StateHolder with the given initialStateProvider.