Package app.cash.molecule

Types

Link copied to clipboard
class AndroidUiDispatcher : CoroutineDispatcher

A CoroutineDispatcher that will perform dispatch during a handler callback or choreographer's animation frame stage, whichever comes first. Use Main to obtain a dispatcher for the process's main thread (i.e. the activity thread).

Link copied to clipboard
class AndroidUiFrameClock(choreographer: Choreographer) : MonotonicFrameClock
Link copied to clipboard
enum RecompositionClock : Enum<RecompositionClock>

Functions

Link copied to clipboard
fun <T> <ERROR CLASS>.launchMolecule(clock: RecompositionClock, body: () -> T): <ERROR CLASS><T>

Launch a coroutine into this CoroutineScope which will continually recompose body to produce a StateFlow stream of T values.

fun <T> <ERROR CLASS>.launchMolecule(clock: RecompositionClock, emitter: (T) -> Unit, body: () -> T)

Launch a coroutine into this CoroutineScope which will continually recompose body to invoke emitter with each returned T value.

Link copied to clipboard
fun <T> moleculeFlow(clock: RecompositionClock, body: () -> T): <ERROR CLASS><T>

Create a Flow which will continually recompose body to produce a stream of T values when collected.