Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
allow dynamic loading to re-use the same loader.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Jan 7, 2014
1 parent 99afcc8 commit aeddf7b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/HTMLImports.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ var importer = {
'script[src][type="text/javascript"]'
].join(','),
loader: function(next) {
if (loader && loader.inflight) {
var currentComplete = loader.oncomplete;
loader.oncomplete = function() {
currentComplete();
next();
}
return loader;
}
// construct a loader instance
loader = new Loader(importer.loaded, next);
// alias the importer cache (for debugging)
Expand Down

0 comments on commit aeddf7b

Please sign in to comment.