Skip to content

Instantly share code, notes, and snippets.

@thegorgon
Created March 29, 2011 18:24
Show Gist options
  • Save thegorgon/892927 to your computer and use it in GitHub Desktop.
Save thegorgon/892927 to your computer and use it in GitHub Desktop.
(function($) {
$.provide = function(object, name, features) {
object[name] = object[name] || {};
$.extend(object[name], features);
return object;
};
}(jQuery));
// Use Case :
// $.provide(GlobalObject, "Feature", {
// function1: function() {},
// function2: function() {}
// });
@thegorgon
Copy link
Author

Forgot to put a description. Essentially module inclusion in javascript with jQuery. Provide "features" to "name" in "object".

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