ParameterizedLazy

class ParameterizedLazy<T, R>(initializer: suspend (T) -> R) : SuspendFunction1<T, R>

A lazy delegate which takes a parameter and provides a value based on it. The value is calculated only once and stored in a map.

Parameters

initializer

A function that creates a new value based on the parameter.

Constructors

Link copied to clipboard
constructor(initializer: suspend (T) -> R)

Functions

Link copied to clipboard
open suspend operator override fun invoke(param: T): R

Provides either an existing R object or creates a new one using initializer function.