Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
Function application as a service
function buildApply() {
var args =, 0);
var fn = args.shift();
// proxy function
return function bindProxy() {
var proxyArgs =, 0);
return fn.apply(null, args.concat(proxyArgs));

This comment has been minimized.

Copy link
Owner Author

@dotproto dotproto commented Dec 10, 2014

Use case is partial application in a scenario where your target function requires access to params it wouldn't otherwise have access to.

      .then( buildApply(proxiedMethod, biz, bazz) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment