Skip to main content

core.lazy

Home > @medplum/core > lazy

lazy() function

Memoizes the result of a parameterless function

Signature:

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

Parameters

ParameterTypeDescription
fn() => TThe function to be wrapped

Returns:

() => T

The result of the first invocation of the wrapped function