Forget about promises, use harvests 3 points by abss 12y ago ↗ HN Harvests: From now is possible to call asynchronous functions in a declarative way and to get almost the same experience as with synchronous code. https://github.com/salboaie/harvests
[–] abss 12y ago ↗ https://github.com/salboaie/harvestsharvest.let('father', loadPenguin, 'MrPenguin'); harvest.let('mother', loadPenguin, 'MrsPenguin'); harvest.let('family', loadPenguinFamily, wait('father'), wait('mother'));The above call do 3 calls without then or declaring ugly callbacks!
1 comment
[ 3.5 ms ] story [ 16.7 ms ] threadharvest.let('father', loadPenguin, 'MrPenguin'); harvest.let('mother', loadPenguin, 'MrsPenguin'); harvest.let('family', loadPenguinFamily, wait('father'), wait('mother'));
The above call do 3 calls without then or declaring ugly callbacks!