Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save leonardreidy/75d06f3b3a59b4f433384f8f305e1be9 to your computer and use it in GitHub Desktop.
Save leonardreidy/75d06f3b3a59b4f433384f8f305e1be9 to your computer and use it in GitHub Desktop.
A Basic JavaScript Library Pattern
/**
* A Basic JavaScript Library Pattern
* From Thomas Valentine and Jonathan Reid, JavaScript Programmers Reference
* Apress,2013, (p.130/289)
*/
(function() {
var window = this,
undefined;
jkl = window.jkl = function(selector) {
return new jkl.jklm.init(selector);
}
jkl.jklm = jkl.prototype = {
init: function(selector) {
this.selector = selector;
return this;
}
}
jkl.jklm.init.prototype = jkl.jklm;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment