Created
June 1, 2014 21:38
-
-
Save alexeyraspopov/eaffd30d5e8f65e739b2 to your computer and use it in GitHub Desktop.
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
function min(initial){ | |
return map(function(value){ | |
if(isNaN(initial) || value < initial){ | |
initial = value; | |
} | |
return initial; | |
}) | |
} | |
function accum(process, acc){ | |
return map(function(value){ | |
acc = process(acc, value); | |
return acc; | |
}); | |
} | |
function getTargetValue(event){ | |
return event.target.value; | |
} | |
function sum(a, b){ | |
return a + b; | |
} | |
event(node, 'change') | |
.pipe(map(getTargetValue)) | |
.pipe(accum(sum, 0)) | |
// .pipe(list()) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment