Sane Async Patterns in JavaScript
slideshare.net
Sane Async Patterns in JavaScript
1–10 of 30 posts
Re: Sane Async Patterns in JavaScript
#2Re: Sane Async Patterns in JavaScript
#3 Next time you're about to define a function with a callback argument, don't.
No, do. It's the prevailing style in Node.js and elsewhere, and so there exist tools to transform them (syntactically or otherwise) into more palpable styles:https://github.com/0ctave/node-sync https://github.com/BYVoid/continuation https://github.com/JeffreyZhao/wind https://github.com/Sage/streamlinejs
Re: Sane Async Patterns in JavaScript
#4Re: Sane Async Patterns in JavaScript
#5Re: Sane Async Patterns in JavaScript
#6Re: Sane Async Patterns in JavaScript
#7Is there some community-standard way of naming/declaring a JS function to let the programmer know just by reading the function's name that it will return a promise instead of a final computed value? I'm interested in knowing how people handle this. It's easy to forget that a function doesn't return a promise if the function name makes no mention of it, so I just make it explicit in the function name... but that's just how I handle it.
Re: Sane Async Patterns in JavaScript
#8While looking through the slides, I was wondering: Is there some community-standard way of naming/declaring a JS function to let the programmer know just by reading the function's name that it will return a promise instead of a final computed value? I'm interested in knowing how people handle this. It's easy to forget that a function doesn't return a promise if the function name makes no mention of it, so I just make…
Otherwise, there's no "naming scheme" for promise-based functions.
Re: Sane Async Patterns in JavaScript
#9This "PubSub" pattern is really trying to recreate RxJS but without the expressiveness - if you find yourself doing this kind of work a lot, you should check it out http://reactive-extensions.github.com/RxJS https://github.com/Reactive-Extensions/RxJS
Re: Sane Async Patterns in JavaScript
#10Next time you're about to define a function with a callback argument, don't. No, do. It's the prevailing style in Node.js and elsewhere, and so there exist tools to transform them (syntactically or otherwise) into more palpable styles: https://github.com/0ctave/node-sync https://github.com/BYVoid/continuation https://github.com/JeffreyZhao/wind https://github.com/Sage/streamlinejs