-
-
Save jbenet/e77066afffe8276b66ca 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
// say i have a pipeline of streams: | |
a.pipe(b).pipe(c).pipe(d) | |
// and these process objects, like | |
{ foo: "hello", bar: 55 } | |
// say i have a magical number processing stream, like "square" which only takes + emits numbers. | |
square.write(5) // emits 25 | |
// And i want to set it up between b and c above. so like | |
a.pipe(b).pipe(square).pipe(c).pipe(d) | |
// but this doesn't work because that stream only takes numbers. | |
// how can i "wrap" the nums stream, to invoke its square magic | |
// only with the number part of an object? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment