The item states of the LoadingItems, its value could be {{ItemState.WORKING}} | {{ItemState.COMPLETE}} | {{ItemState.ERROR}}
Add a new pipe at the end of the pipeline.
A pipe must contain an id
in string and a handle
function, the id must be unique in the pipeline.
The pipe to be appended
Clear the current pipeline, this function will clean up the items.
Copy the item states from one source item to all destination items.
It's quite useful when a pipe generate new items from one source item,
then you should flowIn these generated items into pipeline,
but you probably want them to skip all pipes the source item already go through,
you can achieve it with this API.
For example, an unzip pipe will generate more items, but you won't want them to pass unzip or download pipe again.
The source item
A single destination item or an array of destination items
Let new items flow into the pipeline.
Each item can be a simple url string or an object,
if it's an object, it must contain id
property.
You can specify its type by type
property, by default, the type is the extension name in url.
By adding a skips
property including pipe ids, you can skip these pipe.
The object can contain any supplementary property as you want.
The {{IItem}} to be appended to the current pipeline
Let new items flow into the pipeline and give a callback when the list of items are all completed.
This is for loading dependencies for an existing item in flow, usually used in a pipe logic.
For example, we have a loader for scene configuration file in JSON, the scene will only be fully loaded
after all its dependencies are loaded, then you will need to use function to flow in all dependencies
found in the configuration file, and finish the loader pipe only after all dependencies are loaded (in the callback).
The owner item
The list of urls to be appended as dependencies of the owner.
The callback to be invoked when all dependencies are completed.
Items accepted by the pipeline
This function is invoked when an item has completed all pipes, it will flow out of the pipeline.
The item which is completed
Returns an item in pipeline.
The id of the item
Insert a new pipe at the given index of the pipeline.
A pipe must contain an id
in string and a handle
function, the id must be unique in the pipeline.
The pipe to be inserted
The index to insert
Removes an completed item in pipeline.
It will only remove the cache in the pipeline or loader, its dependencies won't be released.
loader
provided another method to completely cleanup the resource and its dependencies,
please refer to {{Loader.release}}
The id of the item
succeed or not
Generated using TypeDoc
A pipeline describes a sequence of manipulations, each manipulation is called a pipe.
It's designed for loading process. so items should be urls, and the url will be the identity of each item during the process.
A list of items can flow in the pipeline and it will output the results of all pipes.
They flow in the pipeline like water in tubes, they go through pipe by pipe separately.
Finally all items will flow out the pipeline and the process is finished.