There is a way to call to this promises without the defer ? I want to use bluebird
I want it to be called as promise chain with little timeout.
var step1 = function () {
console.log("This is step 1, args=", arguments);
return "ret 1";
};
var step2 = function () {
console.log("This is step 2, args=", arguments);
return "ret 2";
};
var deferred = Q.defer();
var promise0 = deferred.promise;
var promise1 = promise0.then(step1);
var promise2 = promise1.then(step2);
deferred.resolve("foo");
This is the jsFiddle which I use.
http://jsfiddle.net/HKhw8/1067/
Update
I need to add inside every then some logic but still display to the console the step 1,2,3 what am I doing wrong here? http://jsfiddle.net/HKhw8/1073/