tj / co

The ultimate generator based flow-control goodness for nodejs (supports thunks, promises, etc)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

simple version

caub opened this issue · comments

I've seen simple versions of coroutines (sorry not 'cogenerators'), like http://jsbin.com/jelaku/3/edit?html,js,console

what does this module do more ?

Sorry? It does what's mentioned in the Readme

Check the source.
Deals with all corner cases, throws and catches always as expected, deals with arrays and other structures and is as close as possible to the ES7 async/await standard.

Ok thanks, I'm trying to learn about yield

for normal arrays, isn't it just wrapping in Promise.all? but ok for other corner cases

@cauburtin there are some features to yield [] and {}, but I would personally ignore those since they're not future-proof with async/await. I'd stick to Promise.all() etc, that way later you can replace co with async/await when it's natively supported by node