Friday, 13 September 2013

WinJS Promise progress function does not get executed

WinJS Promise progress function does not get executed

I am trying to create a basic promise with a progress function like:
asyncCall().then(function () {
that.output("complete");
},
null,
function(v) {
that.output(v);
}).done();
function asyncCall() {
return new WinJS.Promise(function (complete, error, progress) {
progress("some progress");
setTimeout(function () {
complete();
}, 1000);
});
}
I would expect this to output 'progress' for 1 second and then display
'complete'; however, 'progress' is never outputted. Debugging the
javascript, the progress function gets called on the promise object
however it gets to this code (line 1447 of base.js) and listeners is
undefined:
function progress(promise, value) {
var listeners = promise._listeners;
if (listeners) {
Any idea what I'm missing to handle the progress event?

No comments:

Post a Comment