Function: lazy()
lazy<
T
>(cb
: () =>T
): () =>T
Lazily creates a constant or load a module and caches it internally
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
cb | () => T | The callback to lazily run |
Returns
Function
The value returned by the callback, or the cached value if it was already initialised once.
Returns
T