所以这里我们有一些基于CompoundJS框架的应用程序和一些控制器:
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 */ });
});
问题是:如何index
在所有回调结束后渲染模板?
也许这个答案$.when
中有类似jQuery的描述?