Created
January 19, 2016 21:25
-
-
Save scottcorgan/a108d6263df18322a5dc to your computer and use it in GitHub Desktop.
node pipe vs rx.js
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
// Node streams | |
import through from 'through2' | |
function doSomethingToStream (config) { | |
return through((chunk, enc, next) { | |
next(/* do somethig here */) | |
}) | |
} | |
// VS | |
// Rx.js | |
function doSomethingToObservable (input$) { | |
return input$.map(/* do somethign */) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe something such as this where you process each chunk and transform it? Chances are each source may be an Observable so it will just naturally work.