weakLazy

fun <T : Any> weakLazy(initializer: () -> T): WeakLazy<T>

Returns a WeakLazy that computes its value with initializer.

See WeakLazy for the caching, collection, and thread-safety contract.

val icons = weakLazy { decodeIconAtlas() }

Parameters

initializer

computes the value; may run more than once.