Using rsvp.js or any other promises/A+ implementation how can I turn code like...
console.log('step 1');
setTimeout(function() {
console.log('step 2');
setTimeout(function() {
console.log('step 3');
}, 100);
}, 300);
into a promises implementation?
Create a delay function which returns a Promise and it actually resolves it after the specified time elapses in
setTimeout
, like thisand then you can invoke it like this