Skip to content

Instantly share code, notes, and snippets.

@yelouafi
Created July 17, 2015 02:46
Show Gist options
  • Save yelouafi/7035b71b615d92481407 to your computer and use it in GitHub Desktop.
Save yelouafi/7035b71b615d92481407 to your computer and use it in GitHub Desktop.
// concatMap : (Stream a, a -> Stream b) => Stream b
Stream.prototype.concatMap = function(f) {
return this.map(f).concatAll();
}
// example : log bodies from ajax responses
button.on('click').concatMap( _ => ajaxBody(url) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment