Skip to content

Instantly share code, notes, and snippets.

@Willmo36
Created February 25, 2015 12:54
Show Gist options
  • Save Willmo36/910cb3326461ab530731 to your computer and use it in GitHub Desktop.
Save Willmo36/910cb3326461ab530731 to your computer and use it in GitHub Desktop.
Superagent request with kefir
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