Interface Lazy<T>

Any object that may be disposed.

interface Lazy<T> {
    constructed: boolean;
    set value(value: T);
    clear(): void;
    dispose(): void;
}

Type Parameters

  • T

Hierarchy (view full)

Implemented by

Properties

Accessors

Methods

Properties

constructed: boolean

True if the lazy instance has been constructed.

Accessors

  • set value(value): void
  • Sets the lazy instance's value. If disposed, a DisposedError will be thrown.

    Parameters

    • value: T

    Returns void

Methods

  • Clears the lazy instance, disposing its value. Unlike dispose(), this allows the lazy instance to be reconstructed upon the next get. Typically used only in unit testing. May be used after dispose.

    Returns void

  • Returns void