4 ms·
require('bluebird').coroutine function*() {} Promises + Generators = The sweet spot. Check out https://www.npmjs.com/package/coroutiner https://www.npmjs.com/
by babby 11y ago
require('bluebird').coroutine function*() {}
Promises + Generators = The sweet spot.
Check out https://www.npmjs.com/package/coroutiner https://www.npmjs.com/package/coroutiner to make it stupid-easy to coroutine your entire app.
- karoladamiec 11y agoThat is one perfectly fine way to do it. But that is exactly what i want to highlight. The generators. You can combine them with promises, callbacks, even the CSP channels. But you need the generator. That is where magic happens and no amount of library code will do that for you, one needs compiler support (or a macro...)