Avoiding duplicate downloads
See original GitHub issueI have the issue that scripts are loaded multiple times. I would have expected that scripts that have been loaded or are in the middle of loading won’t be loaded each time.
loadjs(['libraryA.js', 'usingA.js'], {
success: function() { /* done loading */ },
async: false
});
loadjs(['libraryA.js', 'libraryB_usingA.js', 'usingA_B.js'], {
success: function() { /* done loading */ },
async: false
});
In the above example libraryA.js
gets loaded twice. I’ve been trying to avoid this issue by using bundleIds
and loadjs.ready
but this gets complicated quite quickly.
Am I missing something here?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:19 (9 by maintainers)
Top Results From Across the Web
Avoid Duplicate Downloads
This extension will prompt the file… If you are tired of having download(1)(2).pdf in your Downloads folder, look no further. This extension ...
Read more >How to avoid duplicate download. - Microsoft Community
How to avoid duplicate download. ... Look for an extension that works with any page, because that extension works only on the "Pixiv"...
Read more >How to stop duplicate downloads in Chrome [Tip] - dotTech
How to stop duplicate downloads in Chrome · In Chrome, open the “Have I Downloaded This Before?” extension page from the Web Store....
Read more >Avoid Duplicate Downloads - Chrome Extension - Indie Hackers
When downloading files with the same name, Chrome just appends (1) at the end of the filename and saves it to your download...
Read more >How To Avoid Duplicate Downloads In Responsive Images
The idea behind a <picture> example like this is that exactly one image should be downloaded, according to the user's context:.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@groupedsi @naltatis Here’s a new lightweight dependency manager I created called JohnnyDepp that implements the
require
method you requested: https://github.com/muicss/johnnydeppLet me know what you think.
Great! I’m happy to hear you like it. LoadJS and JohnnyDepp share the same underlying file loading code but their API’s are different enough that I thought combining them into one library would be confusing.
JohnnyDepp is tested across all major browsers and should be production-ready so give it a try and let me know if it works for you.