Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

return child loaders when adding one or multiple items.#221

Open
endel wants to merge 2 commits intoCreateJS:master from
endel:return-child-loaders
Open

return child loaders when adding one or multiple items. #221
endel wants to merge 2 commits intoCreateJS:master from
endel:return-child-loaders

Conversation

@endel
Copy link

@endel endel commented Jan 3, 2017

Not a breaking change. It's helpful to add listeners only on some child loaders created inside a LoadQueue.

Example:

var child1 = queue.loadFile(file1);
var child2 = queue.loadFile(file2);
// child item is complete
child1.on("complete", function() { ... });
// all items are complete
queue.on("complete", function() { ... })

Copy link
Member

Thanks! Will do some testing before accepting. Cheers.

Copy link
Author

endel commented Jan 29, 2017

One downside I've seen recently by using this approach is that when adding "complete" listener on the child loader, that item won't be present in the LoadQueue instance yet, due to EventListener dispatching events in FILO order.

The last "complete" listener registered will be the first one to be dispatched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /