Skip to main content

Function: lazy()

lazy<T>(cb: () => T): () => T

Defined in: lazy.ts:6

Lazily creates a constant or load a module and caches it internally

Type Parameters​

Type Parameter
T

Parameters​

ParameterTypeDescription
cb() => TThe callback to lazily run

Returns​

The value returned by the callback, or the cached value if it was already initialised once.

(): T

Returns​

T