would be really nice if we could have the then calls ordered so we can put break points in between them, currently using setTimeout breaks the tests when there is one break point in them.
Would be nice to replace setTimeout with Promises. like this:
// chainable then method
function then(callback) {
var queue = this.queue;
if (!queue)
queue = this.queue = [];
queue.push(Platform.performMicrotaskCheckpoint);
queue.push(callback);
return {
then: then.bind(this),
run: function (doneCallback) {
var runnerPromise = Promise.resolve();
queue.forEach(function (queuedPromise) {
runnerPromise = runnerPromise.then(queuedPromise);
});
if (doneCallback)
runnerPromise.then(doneCallback);
}
};
}
// example usage:
new then(function() {
console.log(1);
}).then(function() {
console.log(2);
}).then(function() {
console.log(3)
}).then(function() {
console.log(3)
}).run(function() {
console.log("complete");
});
would be really nice if we could have the
then
calls ordered so we can put break points in between them, currently using setTimeout breaks the tests when there is one break point in them. Would be nice to replace setTimeout with Promises. like this: