Ah, looks like you're right!
It chains nicely:
function get1() {
console.log('firing get1')
return new Promise(function (resolve) {
setTimeout(resolve, 1000);
});
}
function get2() {
console.log('firing get2')
return new Promise(function (resolve) {
setTimeout(resolve, 1000);
});
}
function get3() {
console.log('firing get3')
return new Promise(function (resolve) {
setTimeout(resolve, 1000);
});
}
get1().then(function () {
console.log("done with get1");
return get2();
}).then(function () {
console.log('done with get2');
return get3();
}).then(function () {
console.log('done with get3');
});