Better HN
topnewbestaskshowjobs
Log inSign up

interroboom

1 karma · joined Nov 14, 2014 (12y ago) · 1 submissions

Submissions

comment 12y ago · link · parent

there are third party libraries (bluebird, co, Q, etc) that use generators to yield promises (or lightweight alternatives such as 'thunks'), and then a helper function that handles waiting for those promises/thunks to return and then resuming the generator. annoying that its not baked into ES6, but it means async code can be basically written like sync code (including typical error handling)