Not quite understand your question.. Generally speaking, Javascript application use a Promise object for deferred and asynchronous operation. For example , do something when two or more asynchronous operations completed (in any order).
Qt do not bundle any Promise implementation by default. You could get a one from my github repo:
benlau/quickpromise
Example
Promise {
resolveWhen: Q.all([endpoint1. onReplyStatusChanged,endpoint2. onReplyStatusChanged]);
onFulfilled: { // It will be triggered only if both of the endpoint emitted the signal
controller.setData1();
controller.setData2();
}
}