SimpleSyntax

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

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 <S : Any, SE : Any> SimpleSyntax<S, SE>.postSideEffect(sideEffect: SE)

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

Link copied to clipboard
suspend fun <S : Any, SE : Any> SimpleSyntax<S, SE>.reduce(reducer: SimpleContext<S>.() -> S)

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

Link copied to clipboard
suspend fun <S : Any, SE : Any> SimpleSyntax<S, SE>.repeatOnSubscription(block: suspend CoroutineScope.() -> Unit)
Link copied to clipboard
suspend fun <S : Any, SE : Any, T : S> SimpleSyntax<S, SE>.runOn(clazz: KClass<T>, predicate: (T) -> Boolean = { true }, block: suspend SubclassStateSimpleSyntax<S, SE, T>.() -> Unit)

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