Cacheable

class Cacheable<T>(val time: Duration = 5.minutes, val getter: () -> T)

A delegate that persists the value obtained from getter for time ms (5 minutes by default). Updates the value after the time has elapsed

Constructors

Link copied to clipboard
constructor(time: Duration = 5.minutes, getter: () -> T)

Properties

Link copied to clipboard
val getter: () -> T
Link copied to clipboard

Functions

Link copied to clipboard
fun clear()
Link copied to clipboard
fun get(): T
Link copied to clipboard
operator fun getValue(thisRef: Any?, property: KProperty<*>): T
Link copied to clipboard
fun refresh(): T
Link copied to clipboard
operator fun setValue(thisRef: Any?, property: KProperty<*>, value: T)