# Loader

Abstract class.

#

Constructors

constructor

#

Accessors

resource

#

Methods

load cancel dispose

#

Constructors

# constructor

constructor(resource: string, resourceData?: string | ArrayBuffer)
1

Populates the loader with data.

Parameters

  • resource: This can either be a resource URL, either an resource ID
  • (optional) resourceData: Explicit data you want to load

#

Accessors

# resource

get resource(): string
1

Gets the loader's resource.

Returns: string

#

Methods

# load

abstract load(): Promise<boolean>
1

This function needs to handle all the resource loading.

Returns: A promise which resolves to a boolean indicating if the loading process completed successfully (true) or was interrupted/failed (false)

# cancel

abstract cancel()
1

This function needs to cancel any ongoing loading process and clean afterwards.

Returns: void

# dispose

abstract dispose()
1

This function needs to dispose of the loader and it's allocated resources.

Returns: void