Skip to main content

getOrCreateGlobalSingleton()

Home > @backstage/version-bridge > getOrCreateGlobalSingleton

Serializes access to a global singleton value, with the first caller creating the value.

Signature:

function getOrCreateGlobalSingleton<T>(id: string, supplier: () => T): T;

Parameters

ParameterTypeDescription
idstring
supplier() => T

Returns:

T