@creator.co/wapi - v1.8.1
    Preparing search index...

    Represents a class that can be used to create a singleton instance of a class that is created asynchronously.

    Type Parameters

    • T
    • R
    Index

    Constructors

    Methods

    Constructors

    • Creates a new instance of the AsyncSingleton class.

      Type Parameters

      • T
      • R

      Parameters

      • factory: (r: R) => Promise<T>

        The factory function that creates the instance.

      • checker: (value: T) => Promise<boolean> = ...

        The function that checks if the instance is valid.

      Returns default<T, R>

    Methods

    • Gets the instance of the class.

      Parameters

      • r: R

        The configuration object for creating the instance.

      Returns Promise<T>