TE
TechEcho
Home
24h Top
Newest
Best
Ask
Show
Jobs
English
GitHub
Twitter
Home
Easy node.js programming
4 points
by
abss
over 11 years ago
3 comments
abss
over 11 years ago
var harvest = require("harvests").create();<p><pre><code> harvest.let('father', loadPenguin, 'MrPenguin'); harvest.let('mother', loadPenguin, 'MrsPenguin'); harvest.let('family', loadPenguinFamily, wait('father'), wait('mother')); harvest.do(function(family){ console.log(family); //also in harvest.father, harvest.mother, harvest.family you got values }, wait('family') ); harvest.onFail(function(error, variable, index){ console.log("Well, move those penguins to the South Pole...", error, variable, index); });</code></pre>
abss
over 11 years ago
Harvests: asynchronous programming as would be synchronous. Simpler alternative to promises and control flow libraries!
salboaie
over 11 years ago
Promoses and flow libraries have steep learning curve