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

Parameter

Type

Description

fn

() => T

The function to be wrapped

Returns:

() => T

The result of the first invocation of the wrapped function