Skip to content

Instantly share code, notes, and snippets.

@benlesh
Created August 23, 2017 01:05
Show Gist options
  • Save benlesh/dee2495071e8cf08156ee206ff8316b9 to your computer and use it in GitHub Desktop.
Save benlesh/dee2495071e8cf08156ee206ff8316b9 to your computer and use it in GitHub Desktop.
Observable.defer(async function() {
const a = await promiseDelay(1000).then(() => 1);
const b = a + await promiseDelay(1000).then(() => 2);
return a + b + await promiseDelay(1000).then(() => 3);
})
.subscribe(x => console.log(x)) // logs 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment