Activated or not.
The map of completed items.
Total count of completed items.
The map of all items.
This is a callback which will be invoked while all items is completed, You can pass the callback function in LoadingItems.create or set it later.
This is a callback which will be invoked while an item flow out the pipeline. You can pass the callback function in LoadingItems.create or set it later.
Total count of all items.
The item states of the LoadingItems, its value could be {{ItemState.WORKING}} | {{ItemState.COMPLETE}} | {{ItemState.ERROR}}
Add a listener for an item, the callback will be invoked when the item is completed.
The item key
Callback function when item loaded
Callback callee
Complete a LoadingItems queue, please do not call this method unless you know what's happening.
Add urls to the LoadingItems queue.
要追加的url列表,url可以是对象或字符串
在已接受的url列表中,可以拒绝某些无效项
移除所有回调。
Destroy the LoadingItems queue, the queue object won't be garbage collected, it will be recycled, so every after destroy is not reliable.
Trigger an event directly with the event name and necessary arguments.
event type
The first argument to be passed to the callback
The second argument to be passed to the callback
The third argument to be passed to the callback
The fourth argument to be passed to the callback
The fifth argument to be passed to the callback
Check whether an item exists.
The item's id.
Returns the content of an internal item.
The item's id.
Returns the error of an internal item.
The item's id.
Checks whether there is correspond event listener registered on the given event
Event type
Callback function when event triggered
Callback callee
Check if the specified key has any registered callback. If a callback is also specified, it will only return true if the callback is registered.
The item key
Callback function when item loaded
Callback callee
Whether the corresponding listener for the item is registered
Check whether all items are completed.
Check whether an item is completed.
The item's id.
Complete an item in the LoadingItems queue, please do not call this method unless you know what's happening.
The item url
Remove event listeners registered with the given event key, callback and target
Event type
The callback function of the event listener, if absent all event listeners for the given type will be removed
The callback callee of the event listener
Register an event listener to a given event key with callback and target.
Event type
Callback function when event triggered
Callback callee
Whether invoke the callback only once (and remove it)
Removes all callbacks registered in a certain event type or all callbacks registered with a certain target
The event type or target with which the listeners will be removed
Removes all callbacks registered in a certain event type or all callbacks registered with a certain target.
The item key to be removed or the target to be removed
Remove an item, can only remove completed item, ongoing item can not be removed.
Removes a listener. It will only remove when key, callback, target all match correctly.
The item key
Callback function when item loaded
Callback callee
The constructor function of LoadingItems, this will use recycled LoadingItems in the internal pool if possible. You can pass onProgress and onComplete callbacks to visualize the loading process.
The pipeline to process the queue.
The items array.
The LoadingItems queue object
Retrieve the LoadingItems queue object for an item.
The item to query
The LoadingItems queue object
Complete an item in the LoadingItems queue, please do not call this method unless you know what's happening.
The item which has completed
Generated using TypeDoc
LoadingItems is the queue of items which can flow them into the loading pipeline.
Please don't construct it directly, use create instead, because we use an internal pool to recycle the queues.
It hold a map of items, each entry in the map is a url to object key value pair.
Each item always contains the following property:
Item can hold other custom properties.
Each LoadingItems object will be destroyed for recycle after onComplete callback
So please don't hold its reference for later usage, you can copy properties in it though.