Skip to content

Instantly share code, notes, and snippets.

@tommedema
Created November 17, 2010 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tommedema/703968 to your computer and use it in GitHub Desktop.
Save tommedema/703968 to your computer and use it in GitHub Desktop.
/* SomeClass.js */
Class("SomeClass", {
use : ["jquery.js", "OtherClass"],
after : {
initialize : function() {
var thisInstance = this;
use("jquery.js", function() {
console.log("Jquery should be loaded here: %o", jQuery);
use("OtherClass", function() {
new OtherClass();
});
});
}
}
});
/* OtherClass.js */
Class("OtherClass", {
after : {
initialize : function() {
console.log("I did not set jquery.js as dependency here, but it is still loaded, see %o", jQuery);
// this is a problem because it should not be available here!!!
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment