Skip to content

Instantly share code, notes, and snippets.

@oliverlundquist
Created July 8, 2016 13:41
Show Gist options
  • Select an option

  • Save oliverlundquist/3e174e84b207a7a104de355eb46a8ebf to your computer and use it in GitHub Desktop.

Select an option

Save oliverlundquist/3e174e84b207a7a104de355eb46a8ebf to your computer and use it in GitHub Desktop.
var a = Rx.Observable.fromEvent(document, 'click')
.flatMapLatest(function () {
return Rx.Observable.defer(function () {
return new Promise(function (resolve) {
setTimeout(function () { resolve('hey'); }, 2000);
});
});
});
var b = a.subscribe(function () { console.log(arguments[0]); });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment