3 ms·
I was thinking the whole way through, "wait, don't generators fix this?" so it was good to see that acknowledged at the end. I'm confused by this, though: >Unf
by GeneralMayhem 12y ago
I was thinking the whole way through, "wait, don't generators fix this?" so it was good to see that acknowledged at the end. I'm confused by this, though:
>Unfortunately, using yield based solution will require third party libraries, which means increased payload and incompatibilities among frameworks.
Do you mean that translating to yield requires wrapping things that aren't expecting it? That's true of moving to any non-callback solution. Or do you mean that you want to see the native Node APIs implemented with generators rather than callbacks? I hope the solution to that will simply be patience.
- fvdessen 12y agoI mean the yield by itself is not a good API, it has to be wrapped in third party Deferreds libraries to be useful - there's an (excellent) linked article which explores this approach : http://jlongster.com/A-Study-on-Solving-Callbacks-with-JavaScript-Generators http://jlongster.com/A-Study-on-Solving-Callbacks-with-JavaS...