Created
February 8, 2011 13:36
-
-
Save jamischarles/816447 to your computer and use it in GitHub Desktop.
This is a great way to define modules for the YUI loader and ensuring the dependencies get pulled in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YUI.add('breeze-nav', function(Y) { | |
Y.namespace('bb.session.Nav'); | |
bb.session.Nav = function() { | |
// expose an API | |
// this in here will execute when it's pulled in through YUI().use() | |
}; | |
}, '0.1.1' /* module version */, { | |
requires: ['node', 'io'] //pull in node, io modules before executing | |
}) | |
// now you can pull it in from another file | |
YUI().use('breeze-nav', function(Y){ | |
//run your code here... | |
//everything in breeze nav will have loaded, and the dependencies | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment