Skip to content

Instantly share code, notes, and snippets.

@RobertFischer
Created May 29, 2014 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobertFischer/0af57bae042da9207fc6 to your computer and use it in GitHub Desktop.
Save RobertFischer/0af57bae042da9207fc6 to your computer and use it in GitHub Desktop.
Demonstration of template function pattern
var function_template = function(method,cssClass,attr) {
return $(this.bulkUpdateEle)[method](cssClass).data(attr);
};
var foo_the_bars = _.partial(function_template, "foo", "bar");
var baz = _.partial(function_template, "baz");
foo({value1:true});
baz("quux", {value1:true});
foo({value2:false});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment