So here we have some application based on CompoundJS framework and some controller on it:
load('application');
action('index', function () {
someMethodWithAsyncCallback({}, function () {
/* async preparing some params for template */
});
anotherMethodWithAsyncCallback({}, function () {
/* async preparing another params for template */
});
// another couple of async calls
// rendering index template
render('index', { /* using async params */ });
});
The question is: how to render template index
after the end of all callbacks?
Maybe there is something like jQuery's $.when
described in this answer?