Skip to main content

TResourceManager

Index

Constructors

constructor

  • new TResourceManager(jobs: default): default
  • Parameters

    • jobs: default

    Returns default

Methods

publicget

  • get<T>(key: string): undefined | T
  • Returns an already loaded resource.

    Must be loaded, otherwise undefined will be returned.


    Type parameters

    • T: IJobAsset | IAsset

    Parameters

    • key: string

    Returns undefined | T

publicisResourcedLoaded

  • isResourcedLoaded(key: string): boolean
  • Checks if a resource is already loaded into the cache


    Parameters

    • key: string

      resource key

    Returns boolean

publicload

  • load<T>(type: new () => T, key: string, config?: unknown): Promise<T>
  • Loads a resource of type T with the specified key. If the resource is already loaded, it returns the cached resource. Otherwise, it fetches the resource, caches the loaded resource, and returns it.


    Type parameters

    • T: IJobAsset | IAsset

    Parameters

    • type: new () => T

      The constructor function of the resource type T.

      • key: string

        The key or URL of the resource to load.

      • optionalconfig: unknown

      Returns Promise<T>

      A promise that resolves to the loaded resource of type T.

    Page Options