Skip to content

Instantly share code, notes, and snippets.

@FiNGAHOLiC
Created January 13, 2012 12:24
Show Gist options
  • Save FiNGAHOLiC/1605851 to your computer and use it in GitHub Desktop.
Save FiNGAHOLiC/1605851 to your computer and use it in GitHub Desktop.
Module pattern (jQuery)
// http://speakerdeck.com/u/addyosmani/p/large-scale-javascript-application-architecture
function library(module){
$(function(){
if(module.init){
module.init();
};
});
return module;
};
var myLibrary = library(function(){
return{
init : function(){
/* implementation */
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment