Skip to content

ResourceLoader.add(...) does not operate like a queue #155

Description

@iyobo

Hello,
According to the docs, the purpose of the loader.add(...) function is to enqueue something for loading.

What is the point of "enqueueing" something when doing so multiple times throws an error like
Error: Cannot add resources while the loader is running.. Why should the loader being in an active processing state stop enqueuement?

The word enqueue suggests Buffering the work items until the processor is ready, after which the processor pops (i.e array.unshift) the next work item off the list, and on it goes.

My use case is that I am using Pixi.js, which uses this library, to load textures somewhat adhoc as needed.

Could you shed more light on this "Error: Cannot add resources while the loader is running." error? I'd like to learn why it was implemented this way so I know whether to make a PR to improve on this behavior.

Thanks for the tool.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions