Skip to content

Instantly share code, notes, and snippets.

@hatched
Created December 11, 2012 23:58
Show Gist options
  • Save hatched/4263533 to your computer and use it in GitHub Desktop.
Save hatched/4263533 to your computer and use it in GitHub Desktop.
YUI({
modules: {
'module1': {
path: 'path/to/module1.js',
requires: ['modules', 'this', 'requires']
}
}
}).use('node', function(Y) {
//module1 is not loaded
Y.use('module1', function(Y) {
//module 1 has been fetched from the server and then
//loaded into the parent sandbox then this callback is called
}) ;
//module1 is not available until the above use returns
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment