Package-level declarations

Functions

Link copied to clipboard
fun <B : StateEmitter<S>, S : Any> BlocBuilder(bloc: B, content: @Composable (state: S) -> Unit)

A composable that subscribes to a StateEmitter's state stream and passes the current state to content on every emission.

fun <B : StateEmitter<S>, S : Any> BlocBuilder(blocClass: KClass<B>, content: @Composable (state: S) -> Unit)
fun <B : StateEmitter<S>, S : Any> BlocBuilder(blocClass: KClass<B>, buildWhen: (previous: S, current: S) -> Boolean, content: @Composable (state: S) -> Unit)

Overload that resolves the bloc from BlocRegistry by KClass.

fun <B : StateEmitter<S>, S : Any> BlocBuilder(bloc: B, buildWhen: (previous: S, current: S) -> Boolean, content: @Composable (state: S) -> Unit)

A composable that rebuilds content only when buildWhen approves a state transition.

Link copied to clipboard
fun <B : StateEmitter<S>, S : Any> BlocConsumer(bloc: B, listenWhen: (previous: S, current: S) -> Boolean? = null, listener: (state: S) -> Unit, buildWhen: (previous: S, current: S) -> Boolean? = null, content: @Composable (state: S) -> Unit)

A composable that combines BlocListener and BlocBuilder with buildWhen into a single, declarative component.

fun <B : StateEmitter<S>, S : Any> BlocConsumer(blocClass: KClass<B>, listenWhen: (previous: S, current: S) -> Boolean? = null, listener: (state: S) -> Unit, buildWhen: (previous: S, current: S) -> Boolean? = null, content: @Composable (state: S) -> Unit)

Overload that resolves the bloc from BlocRegistry by KClass.

Link copied to clipboard
fun <B : StateEmitter<S>, S : Any> BlocListener(bloc: B, listenWhen: (previous: S, current: S) -> Boolean? = null, listener: (state: S) -> Unit, content: @Composable () -> Unit = {})

A composable that reacts to StateEmitter state changes as side effects, without causing content to rebuild.

fun <B : StateEmitter<S>, S : Any> BlocListener(blocClass: KClass<B>, listenWhen: (previous: S, current: S) -> Boolean? = null, listener: (state: S) -> Unit, content: @Composable () -> Unit = {})

Overload that resolves the bloc from BlocRegistry by KClass.

Link copied to clipboard
fun BlocProvider(blocs: List<StateEmitter<*>>, content: @Composable () -> Unit)

A composable that registers StateEmitter instances (Bloc or Cubit) with BlocRegistry and makes them available to any descendant composable.

Link copied to clipboard
fun <B : StateEmitter<S>, S : Any, V : Any> BlocSelector(bloc: B, selector: (state: S) -> V, content: @Composable (value: V) -> Unit)

A composable that derives a value from a StateEmitter's state and rebuilds content only when that derived value changes.

fun <B : StateEmitter<S>, S : Any, V : Any> BlocSelector(blocClass: KClass<B>, selector: (state: S) -> V, content: @Composable (value: V) -> Unit)

Overload that resolves the bloc from BlocRegistry by KClass.