BroadcastEvent

open class BroadcastEvent<A>(node: Node<EventState<A>>) : Event<A> (source)

A BroadcastEvent is an Event that can have new values emitted to it.

Usually used as an internal API to build up a new Event.

Created with the externalEvent function.

Constructors

Link copied to clipboard
constructor(node: Node<EventState<A>>)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
suspend fun collect(collector: FlowCollector<A>)
Link copied to clipboard
fun <A> Event<A>.debounced(window: Duration): Event<A>

Blocks occurrence of events until the window of time has passed, after which the latest event will be emitted.

Link copied to clipboard
fun filter(f: (A) -> Boolean): Event<A>

Applies the supplied function to each element of the Event, and produces an event that only emits if the function evaluates to true.

Link copied to clipboard
fun gate(condition: Behavior<Boolean>): Event<A>

Returns an Event that only fires if the condition does not hold at a particular time.

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

Method version of Signal.hold.

Link copied to clipboard
inline fun <A> Event<A>.impulse(zero: @UnsafeVariance A): Behavior<A>

Builds a dirac impulse whose value is equal to the event values when the even has fired, and whole value is equal to zero otherwise

inline fun <A, B> Event<A>.impulse(zero: B, value: B): Behavior<B>

Builds a dirac impulse whose value is equal to value whenever the event fires, and zero otherwise.

Link copied to clipboard
fun <B> map(f: SampleScope.(A) -> B): Event<B>

Applies the passed function f to each event that is emitted, producing a new transformed Event stream.

Link copied to clipboard
fun <B : Any> mapNotNull(f: (A) -> B?): Event<B>
Link copied to clipboard
fun <B> scan(initial: B, reducer: SampleScope.(B, A) -> B): Signal<B>

Method version of Signal.fold, for easier use in method chains.

Link copied to clipboard
fun send(value: A)
Link copied to clipboard
fun <A> Event<A>.throttled(duration: Duration): Event<A>

Creates a modified Event that emits events at a frequency of at most duration.

Link copied to clipboard
fun window(size: Int): Event<List<A>>

Takes and event, and constructs a moving window of size when events occur.