-
-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Idempotent request option #95
Comments
Here are two loading scenarios:
loadjs('/file.js', function() { /* callback1 */ }); // fetch over network
loadjs('/file.js', function() { /* callbcak2 */ }); // fetch from cache
loadjs('/file.js', 'file-load');
loadjs.ready('file-load', function() { /* callback1 */ });
loadjs.ready('file-load', function() { /* callback2 */ }); Does your use case fit under one of these? |
Sorry for late answer.
That's is why I was thinking about a method of specifying cache before any loadjs function run. |
Unfortunately, if the file is being loaded outside of LoadJS then it's going to be difficult to detect whether or not it has already been fetched/loaded. I'm not sure it's even possible to detect all file downloads triggered by other code. |
Agree with you but my Idea was to "tell" this plugin that x,y,z files have been loaded by some other code and plugin "can" safely run the callback instead of throwing error. Nothing fancy, just need this since you know plugins code better - maybe a method similar to 'isDefined' ... loadJs.preloadCache( [file-id-1, file-id-2, ...] ); |
Why do you need LoadJS for this? Why not just run the callback after the files have been loaded? |
From @BicanMarianValeriu:
#94
The text was updated successfully, but these errors were encountered: