Skip to main content

CachedImage <T>

Cached image data

Hierarchy

Index

Constructors

constructor

  • Create a new cached image.


    Parameters

    • cache: ImageCache<T>

      The cache holding the image

    • url: string

      The URL for the image to cache

    Returns CachedImage<T>

Properties

data

data: T

The decoded payload; null until decoding completes.

lastUsed

lastUsed: number

state

state: string

url

url: string

Accessors

complete

  • get complete(): boolean
  • Returns boolean

height

  • get height(): number
  • Get the image's height


    Returns number

width

  • get width(): number
  • Get the image's width


    Returns number

Methods

_load

  • _load(errCause): Promise<void>
  • Load the cached image if it's not already available.

    Reports its outcome through the state, and never rejects.


    Parameters

    • errCause: Error = undefined

      An error object the be attached as cause for failed fetch responses. Used primarily for extending the traceback

    Returns Promise<void>

isAsset

  • isAsset(): boolean
  • Is the image an asset image?


    Returns boolean

isDoneLoading

  • isDoneLoading(): boolean
  • Is the image loading complete (either succesfully or not)?


    Returns boolean

isFailing

  • isFailing(): boolean
  • Is the image experiencing problems loading?


    Returns boolean

isLoaded

  • Is the image loaded and ready?

    When this is true, data is available.


    Returns this is LoadedCachedImage<T>

isLoading

  • isLoading(): boolean
  • Is the image currently being loaded?


    Returns boolean

unload

  • unload(): void
  • Unload the image from the cache


    Returns void