Skip to main content

Class: Lazy<T>

util.Lazy

A wrapper class to lazily initialize a value. Supports custom factory and predicate methods.

Type parameters#

Name
T

Constructors#

constructor#

• new Lazy<T>(factory, exists?)

Type parameters#

Name
T

Parameters#

NameType
factoryLazyFactory<T>
existsExistsPredicate<T>

Defined in#

util/lazy.ts:26

Accessors#

current#

• get current(): T

The current value of the lazy object. Will be initialized, if the 'exists' predicate doesn't match.

Returns#

T

Defined in#

util/lazy.ts:19