winjs-promise

Lightswitch html how to know when async iteration is done

人走茶凉 提交于 2019-12-08 03:36:37
问题 I have an async operation inside another async operation. I wonder how can i know when everything is done. Here is my code: msls.showProgress(msls.promiseOperation(function (operation) { screen.Staff.getConfirmedWaiters().then(function (result) { result.each(function (item) { item.getWaiter().then(function (result) { if (result.Gender == "Female") { confirmedGirls++; } }); }); operation.complete(confirmedGirls); }); }).then(function (result) { First I load the ConfirmedWaiters collection.

Lightswitch html how to know when async iteration is done

隐身守侯 提交于 2019-12-06 08:51:54
I have an async operation inside another async operation. I wonder how can i know when everything is done. Here is my code: msls.showProgress(msls.promiseOperation(function (operation) { screen.Staff.getConfirmedWaiters().then(function (result) { result.each(function (item) { item.getWaiter().then(function (result) { if (result.Gender == "Female") { confirmedGirls++; } }); }); operation.complete(confirmedGirls); }); }).then(function (result) { First I load the ConfirmedWaiters collection. Once it is completed I iterate every entity and load a child entity async, so I want to know when the