Created
November 4, 2016 18:08
-
-
Save leonardreidy/75d06f3b3a59b4f433384f8f305e1be9 to your computer and use it in GitHub Desktop.
A Basic JavaScript Library Pattern
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
/** | |
* 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