Created
February 25, 2015 12:54
-
-
Save Willmo36/910cb3326461ab530731 to your computer and use it in GitHub Desktop.
Superagent request with kefir
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
let requestStream = Kefir.emitter(); | |
let responseStream = requestStream.map(url => { | |
return Kefir.fromCallback(cb=> request.get(url).end(cb)); | |
}).flatMap(); | |
responseStream.onValue(v=>{ | |
console.log("kefir log",v); | |
}); | |
requestStream.emit("data.json"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment