sample

open fun sample(times: Event<Any?> = Timeline.currentTimeline().clock): Event<A>(source)

Sample a Behavior at the occurrences of times, returning a new Event with the values of the behavior at those times.

Useful for producing a sampled version of a continuous behavior.

Example:

val signal: Behavior<Double> = ...

val sampled = signal
.sample(Event.tick(1.second))

Compare with tag from Reflex.