ValueCache

class ValueCache<T>

ValueCache caches a value based on dependencies. Any time a dependency changes, the value is recomputed. If the dependencies do not change, the cached value will be returned.

val myValueCache = ValueCache()

fun main() {
val result = myValueCache(dependency1) { /* Compute your value */}
}

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
operator fun invoke(vararg dependencies: Any?, compute: () -> T): T
Link copied to clipboard
fun reset()