TickingValueProvider
Simple interface that allows implementors to provide a TickingValue for a given reference point.
Functions
Link copied to clipboard
suspend fun <T> TickingValueProvider<T>.collect(clock: Clock, timeZone: TimeZone, maxTick: Duration? = null, initialReference: Zoned<Instant> = Zoned(clock.now(), timeZone), initialValue: TickingValue<T> = this.provide(initialReference), collector: suspend (T) -> Unit)
Function that calls collector with the TickingValue.value calculated by this TickingValueProvider.provide each time there is a new value.
Link copied to clipboard
fun <T, R> TickingValueProvider<T>.map(transform: (localized: TickingValue<T>, reference: Zoned<Instant>) -> TickingValue<R>): TickingValueProvider<R>
Simple mapping function that returns a new TickingValueProvider that, upon TickingValueProvider.provide, calls transform with the result of provide and its reference point, and returns the output of transform.