Created
March 6, 2013 03:23
-
-
Save trxcllnt/5096463 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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