Skip to content

Instantly share code, notes, and snippets.

@jtenner
Created November 8, 2013 18:56
Show Gist options
  • Save jtenner/7375755 to your computer and use it in GitHub Desktop.
Save jtenner/7375755 to your computer and use it in GitHub Desktop.
!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