Skip to content

Instantly share code, notes, and snippets.

@trxcllnt
Created March 6, 2013 03:23
Show Gist options
  • Select an option

  • Save trxcllnt/5096463 to your computer and use it in GitHub Desktop.

Select an option

Save trxcllnt/5096463 to your computer and use it in GitHub Desktop.
package org.tinytlf.fn
{
import raix.interactive.toEnumerable;
/**
* @author ptaylor
*/
public function pipe(...functions):Function {
return function(...args):* {
return toEnumerable(functions).reduce(args, function(args:Array, func:Function):Array {
const val:* = func.apply(null, args);
return val === undefined ? [] : [val];
}, pluck('0'));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment