Created
December 20, 2017 16:02
-
-
Save jooyunghan/2b2a6ab48623e9de113fc99228044723 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function consume(obs) { | |
try { | |
for await (const n of obs) { | |
console.log(n); | |
} | |
} catch (e) { | |
console.log('got it', e.message); | |
} | |
console.log('done'); | |
} | |
consume(Observable.interval(100).do(n => console.assert(n < 5))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment