Companion

Functions

Link copied to clipboard
fun <A> combineAll(vararg states: Signal<A>): Signal<List<A>>
Link copied to clipboard
fun <A> const(value: A): Signal<A>
Link copied to clipboard
fun <A> fold(initial: A, vararg actions: Event<(A) -> A>): Signal<A>

fun <A, B> fold(initial: A, events: Event<B>, reducer: SampleScope.(A, B) -> A): Signal<A>

Construct a Signal by suppling an initial value, a set of events driving the updates of the Signal, together with a reducer describing how new events update the existing state.

Link copied to clipboard
fun <A> hold(initial: A, update: Event<A>): Signal<A>

Produce a new Signal by providing an initial value, which is held constant until the update function occurs, at which point it will hold that value until the next update.