Manual Reference Source Test
import QueueItem from 'beloader/src/queueitem.js'
public class | version 1.0.0 | since 1.0.0 | source

QueueItem

Extends:

AbstractEventManager → QueueItem

QueueItem handles all item behaviours in the loading queue. Given its type and options, it will load the appropriate loader and process request.

Constructor Summary

Public Constructor
public

constructor(type: string, parent: Beloader, options: DotObjectArray)

version 1.0.0 since 1.0.0

Member Summary

Public Members
public

Async mode trigger

public

Autoprocess trigger

public

Awaiting mode, dependencies listing

public

Defer mode trigger

public

error: *

public

Id of the item

public

Loader instance

since 1.0.0
public

Loader ready promise

since 1.0.0
public

Requesting parent item

since 1.0.0
public

Stores item progress

since 1.0.0
public

Item process promise

since 1.0.0
public

Stores the state of the item

since 1.0.0
Private Members
private

Map plugins

since 1.0.0

Method Summary

Public Methods
public

process(): *

Process the request for the QueueItem

version 1.0.0 since 1.0.0
Private Methods
private

_abort()

abort built-in callback

version 1.0.0 since 1.0.0
private

_error(ev: *)

error built-in callback

version 1.0.0 since 1.0.0
private

_load()

load built-in callback

version 1.0.0 since 1.0.0
private

loadend built-in callback

version 1.0.0 since 1.0.0
private

loadstart built-in callback

version 1.0.0 since 1.0.0
private

_progress(event: *)

progress built-in callback

version 1.0.0 since 1.0.0
private

_ready()

ready built-in callback

version 1.0.0 since 1.0.0
private

timeout built-in callback

version 1.0.0 since 1.0.0

Inherited Summary

From class AbstractEventManager
private

Callback's list by eventName

since 1.0.0
public

fire(eventName: string, target: Beloader | QueueItem | Loader | Plugin, data: object | array | number | string)

Fire an event

version 1.0.0 since 1.0.0
public

on(eventName: string, callback: Function)

Register events callbacks after instance creation

version 1.0.0 since 1.0.0
private

Dispatch an event

version 1.0.0 since 1.0.0

Public Constructors

public constructor(type: string, parent: Beloader, options: DotObjectArray) version 1.0.0 since 1.0.0 source

Constructor

Override:

AbstractEventManager#constructor

Params:

NameTypeAttributeDescription
type string

Type of item. See Beloader#fetch

parent Beloader

Beloader calling instance

options DotObjectArray

Options for QueueItem and underlying loader

Public Members

public async: boolean source

Async mode trigger

See:

public autoprocess: boolean source

Autoprocess trigger

See:

public awaiting: Array source

Awaiting mode, dependencies listing

See:

public defer: boolean source

Defer mode trigger

See:

public error: * source

public id: string source

Id of the item

See:

public loader: Loader since 1.0.0 source

Loader instance

public loaderReady: Promise since 1.0.0 source

Loader ready promise

public parent: Beloader since 1.0.0 source

Requesting parent item

public progress: DotObjectArray since 1.0.0 source

Stores item progress

public promise: Promise since 1.0.0 source

Item process promise

public state: Object since 1.0.0 source

Stores the state of the item

Properties:

NameTypeAttributeDescription
state.waiting boolean

true if item is waiting to be processed

state.pending boolean

true if item's loading is in progress

state.loaded boolean

true if item's loading is completed and successfull

state.error boolean

true if item's loading is in error, aborted or timed out

state.abort boolean

true if item's loading is aborted

state.timeout boolean

true if item's loading is in timeout

state.processed boolean

true if item's process is over (loading + initialization)

state.resolved boolean

true if item's promise have been resolved

state.ready boolean

true if item is ready to be used

Private Members

private _plugins: DotObjectArray since 1.0.0 source

Map plugins

Public Methods

public process(): * version 1.0.0 since 1.0.0 source

Process the request for the QueueItem

Return:

*

Emit:

load

error

loadend

Private Methods

private _abort() version 1.0.0 since 1.0.0 source

abort built-in callback

private _error(ev: *) version 1.0.0 since 1.0.0 source

error built-in callback

Params:

NameTypeAttributeDescription
ev *

private _load() version 1.0.0 since 1.0.0 source

load built-in callback

private _loadend() version 1.0.0 since 1.0.0 source

loadend built-in callback

private _loadstart() version 1.0.0 since 1.0.0 source

loadstart built-in callback

private _progress(event: *) version 1.0.0 since 1.0.0 source

progress built-in callback

Params:

NameTypeAttributeDescription
event *

private _ready() version 1.0.0 since 1.0.0 source

ready built-in callback

private _timeout() version 1.0.0 since 1.0.0 source

timeout built-in callback