StateProvider

interface StateProvider<out S : MVIState>

An entity that exposes states and allows StateConsumers to subscribe to them. Most often accessed through a Store as a Provider.

Inheritors

Properties

Link copied to clipboard
abstract val state: S

Obtain the current state in an unsafe manner. This property is not thread-safe and parallel state updates will introduce a race condition when not handled properly. Such race conditions arise when using multiple data streams such as Flows.

Link copied to clipboard
abstract val states: StateFlow<S>

A flow of states to be handled by the subscriber.