[–] abss 12y ago ↗ Harvests: asynchronous programming as would be synchronous. Simpler alternative to promises and control flow libraries!
[–] abss 12y ago ↗ var harvest = require("harvests").create(); 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); });
3 comments
[ 3.5 ms ] story [ 23.2 ms ] thread