UNPKG

@altostra/core

Version:

Core library for shared types and logic

19 lines (18 loc) 486 B
/** * A value that is lazily initialized only when is first being get */ export declare class Lazy<T> { #private; /** * Create a value that is lazily initialized only when is first being get * @param factory A function to initialize the value */ constructor(factory: () => T); /** Gets an initialized value */ get value(): T; /** * Gets `true` if the values was already initialized; \ * Otherwise gets `false`. */ get isSet(): boolean; }