Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
expect class PlatformLocale
Link copied to clipboard
data class TickingValue<out T>(val value: T, val nextTick: Duration?)

This class holds a value of type T and a Duration that indicates how much time needs to pass before recalculating value is required (i.e. how long since its production nextTick is valid for).

Link copied to clipboard
data class Zoned<out T>(val value: T, val timeZone: TimeZone)

Hodler for a generic value T that is associated with a TimeZone

Functions

Link copied to clipboard
fun <T1, T2, R> TickingValue<T1>.combine(other: TickingValue<T2>, transform: (T1, T2) -> R): TickingValue<R>

Combines two different TickingValues.

Link copied to clipboard
fun <T, R> TickingValue<T>.flatMap(transform: (T) -> TickingValue<R>): TickingValue<R>

Transforms this TickingValue using the transform function. The resulting TickingValue.nextTick will be the min of the two, see also withNextTickAtMost.

Link copied to clipboard
fun <T, R> TickingValue<T>.map(transform: (T) -> R): TickingValue<R>

Transforms the TickingValue.value from this instance from type T to R using transform and returns a new TickingValue with it and the same TickingValue.nextTick.

Link copied to clipboard
operator fun Zoned<Instant>.minus(duration: Duration): Zoned<Instant>
Link copied to clipboard
operator fun Zoned<Instant>.plus(duration: Duration): Zoned<Instant>
Link copied to clipboard

Returns a civil datetime value that this instant Zoned.value has in the specified Zoned.timeZone.

Link copied to clipboard

Returns a TickingValue with the same TickingValue.value and with the next tick being the min of its value and nextTick.

Link copied to clipboard

Returns a Zoned<Instant> using this Clock as source and TimeZone.currentSystemDefault for timezone.