Skip to content

Instantly share code, notes, and snippets.

@jooyunghan
Created December 20, 2017 16:09
Show Gist options
  • Save jooyunghan/bdf979c25cca5b4d853996e437e6bb84 to your computer and use it in GitHub Desktop.
Save jooyunghan/bdf979c25cca5b4d853996e437e6bb84 to your computer and use it in GitHub Desktop.
async function consume2(obs) {
const ai = obs[Symbol.asyncIterator]();
ai.next().then(r => console.log(0, r), e => console.log(0, e.message));
ai.next().then(r => console.log(1, r), e => console.log(1, e.message));
ai.next().then(r => console.log(2, r), e => console.log(2, e.message));
ai.next().then(r => console.log(3, r), e => console.log(3, e.message));
}
consume2(Observable.interval(100).do(n => console.assert(n < 1)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment