SubStateSyntax

class SubStateSyntax<S : Any, SE : Any, T : S>(containerContext: SubStateContainerContext<S, SE, T>)(source)

Constructors

Link copied to clipboard
constructor(containerContext: SubStateContainerContext<S, SE, T>)

Properties

Link copied to clipboard
val state: T

The current state which can change throughout execution of the orbit block

Functions

Link copied to clipboard
suspend fun postSideEffect(sideEffect: SE)

Side effects allow you to deal with things like tracking, navigation etc.

Link copied to clipboard
suspend fun reduce(reducer: IntentContext<T>.() -> S)

Reducers reduce the current state and incoming events to produce a new state.

Link copied to clipboard
suspend fun repeatOnSubscription(block: suspend CoroutineScope.() -> Unit)

Starts and stops the provided block of code based on the number of subscribers to the Container.refCountStateFlow and Container.refCountSideEffectFlow.