core.lazy | Medplum

lazy() function

Memoizes the result of a parameterless function

Signature:

export declare function lazy<T>(fn: () => T): () => T;

Parameters

Parameter Type Description
fn () => T The function to be wrapped

Returns:

() => T

The result of the first invocation of the wrapped function