ExpiringValueWrapper

class ExpiringValueWrapper<T : Any>(valueGetter: suspend () -> Pair<T, LocalDateTime>)

A wrapper around a value of type T that caches it until expiration time hasn't come and then recalculates using valueGetter

Constructors

Link copied to clipboard
constructor(valueGetter: suspend () -> Pair<T, LocalDateTime>)

Functions

Link copied to clipboard
suspend fun getValue(): T