Created
May 29, 2014 16:46
-
-
Save RobertFischer/0af57bae042da9207fc6 to your computer and use it in GitHub Desktop.
Demonstration of template function pattern
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
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