updateState

protected fun updateState(block: State.() -> State)(source)

Applies a reducer function to the current state and emits the result atomically.

The receiver of block is the current state, allowing copy(...) calls directly on data classes:

updateState { copy(isLoading = false, items = newItems) }

Parameters

block

Reducer that transforms the current state into a new state.