Skip to content

Instantly share code, notes, and snippets.

@jtenner
Created November 8, 2013 18:41
Show Gist options
  • Save jtenner/7375540 to your computer and use it in GitHub Desktop.
Save jtenner/7375540 to your computer and use it in GitHub Desktop.
!function(window, document, undefined){
plugins = [];//Plugin storage object
function constructorObject(options){//object constructor
var self = this; //store itself for later
plugins.forEach(function(plugin){
plugin(self, options);//pass this instance of the constructed object to the plugin
//the options used to construct it are also passed as well
});
}
constructorObject.plugin = function(func){//function to define plugins exposed
plugins.push(func);//append the plugin
};
window["constructorObject"] = constructorObject;//expose the constructor
}(window,document)
@ansco05069
Copy link

bb:45:e9:42:fb:f5:a9:b2:84:b1:02:36:a0:94:44:01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment