Concrete implementation of IAsset for assets that are stored in memory.

Hierarchy

  • LocalAsset

Implements

Constructors

  • Create a new instance of a LocalAsset.

    Parameters

    • type: AssetType
    • initBlobs: {
          blob: Blob;
          key: string;
      }[] = []

      An array of blobs alongside their keys that can be served by this asset. Most involved classes have their own AssetKey* enum to define possible asset keys.

    Returns LocalAsset

Methods

  • Get a component of this asset associated with the specified key. Returns a blob incase the component is available, otherwise it will throw an error. This is the entrypoint from which components are requested for local purposes. (aka. when no compute server is involved.)

    Returns

    A promise that resolves to the components blob.

    Parameters

    • key: string

      The key that the component is associated with.

    Returns Promise<Blob>

  • Initiates a pre-loading of all components. Use this with caution as it will load all available assets. Sometimes we don't need to access all assets though. This would trigger unnecessary network transfers and consume additional memory!

    Returns Promise<void>

Generated using TypeDoc