CachedProperty

fun <KEY : Any, VALUE> CachedProperty(keyProperty: () -> KEY, lazy: Boolean = false, factory: (KEY) -> VALUE)

Parameters

keyProperty

Function that provides the latest value of the cache key.

lazy

Whether to initialize the value immediately, or upon first invocation.

factory

Function to create the property value based on its current cache key.