Skip to content

Instantly share code, notes, and snippets.

@benlesh
Created August 23, 2017 01:06
Show Gist options
  • Save benlesh/da9634b1c1975e9c156868f088d61833 to your computer and use it in GitHub Desktop.
Save benlesh/da9634b1c1975e9c156868f088d61833 to your computer and use it in GitHub Desktop.
const source$ = Observable.interval(1000).take(3); // 0, 1, 2
// waits 3 seconds, then logs "2".
// because the observable takes 3 seconds to complete, and
// the interval emits incremented numbers starting at 0
async function test() {
console.log(await source$.toPromise());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment