5 ms·
Does this offer any benefits over building coroutine functions with generators? The "co" library (and probably some others) do this. https://github.com/tj/co h
by BFay 12y ago
Does this offer any benefits over building coroutine functions with generators? The "co" library (and probably some others) do this.
https://github.com/tj/co https://github.com/tj/co
It seems mostly like a syntactical difference to me - with coroutines you "yield" instead of "await." You can still wrap things nicely in try{} catch{} blocks.
But the readme for co does mention that it's a stepping stone towards async/await. I like that ES7 will allow us to write this style of function without including an additional library, but apart from that, is there a big gap in functionality between the different approaches?