queryloader2
queryloader2 copied to clipboard
Slow loading if no images found.
When the page has no images, the plugin wait for the maxTime
to complete, instead of just completing right away.
Example: http://jsbin.com/dureti/edit?html,output - Contains 1 image, loads pretty fast. http://jsbin.com/henaba/edit?html,output - Has no images, takes really long time to complete.
What if we add a check after getImageSrcs
function on https://github.com/Gaya/queryloader2/blob/183e0c0ae129300982c8e68e5eaba1f0c87c0d41/src/ImagePreloader/index.js#L29
if (this.sources.length === 0) {
this.done === true;
this.updateProgress();
}
Sounds like a good plan! You can add a pull request if you'd like to fix this problem.