Created
January 13, 2012 12:24
-
-
Save FiNGAHOLiC/1605851 to your computer and use it in GitHub Desktop.
Module pattern (jQuery)
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
// 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