Syntax

class Syntax<S : Any, SE : Any>(val containerContext: ContainerContext<S, SE>)(source)

Constructors

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

Properties

Link copied to clipboard
Link copied to clipboard
val state: S

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<S>.() -> 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.

Link copied to clipboard
inline suspend fun <T : S> runOn(crossinline predicate: (T) -> Boolean = { true }, crossinline block: suspend SubStateSyntax<S, SE, T>.() -> Unit)

This API is intended to simplify and add type-safety to working with sealed class states.