3 ms·
The problem with Javascript generators, however, is that you're not allowed to call other functions from them, which yield. This very much limits the kind of as
by amelius 11y ago
The problem with Javascript generators, however, is that you're not allowed to call other functions from them, which yield. This very much limits the kind of async stuff you can do with them.
- tlrobinson 11y agoNot really (at least not the kind of stuff I mentioned), those functions can just return promises which the caller yields: http://codepen.io/anon/pen/WvzGLa http://codepen.io/anon/pen/WvzGLa Granted async/await syntax will make this a bit nicer: async function funcA() { await sleep(1000); // ...
- amelius 11y agoBut then the called functions have to be written async style.