Created
November 8, 2013 18:56
-
-
Save jtenner/7375755 to your computer and use it in GitHub Desktop.
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
!function(constructorObject, undefined){ | |
constructorObject.plugin(function(self, options){ | |
//Plugin constructor code goes here | |
//Now you have access to the self object and options by reference | |
if(typeof options !== "undefined" && options.property)//put some logic here... | |
self.protofunc();//call a function on itself | |
}); | |
constructorObject.prototype.protofunc = function(){// in the closure space, modify it's prototype | |
console.log("hello world!"); | |
} | |
}(constructorObject/*, additional plugin dependencies*/) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment