JavaScript has the method Promise.all() that allows one to create a promise that resolves when all of a list of promises have been resolved. This project offers a more powerful version that roughly speaking allows one to specify
- a list of promises, and
- dependencies between them,
and create a single promise that resolves when the entire network of promises has been resolved.
The project's code is a single function (promiseDAG) in a single file (promiseDAG.js).
Just add this file to your JavaScript project, and call the promiseDAG function.
An illustrated explanation of what promiseDAG does can be found at https://daanmichiels.github.io/promiseDAG/.
You can see a demo at https://daanmichiels.github.io/promiseDAG/demo/.
At some point, I wrote up a short article about promiseDAG at The Code Project. You can find it here.
This project is released under the LGPL-3.0.