Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. someapifunc() // Returns a promise
  2.  
  3. function* apifuncs() {
  4. var index = yield 1;
  5. index++;
  6. yield someapifunc(index - 1);
  7. }
  8.  
  9. let calls = apifuncs();
  10. apifuncs.next().value.then() // Works
  11. apifuncs.next().value.then() // This won't because index and everything is out of the current scope
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement