Ive been reading about promises for a while now.. but when it came down to the real thing, i figured I cant find the correct syntax. I need your help, I dont understand something basic, please help me find it.
Here is my broken code:
var Q = require('es6-promise').Promise;
function timePrinting(num) {
return function promice(resolve, reject) {
/*time consuming action*/
return resolve("Complete printing " + num + " seconds");
}
}
Q = timePrinting(15).then(console.log(data), null);
Problem is it dosent work... There is something wrong with the syntax of the call or the logic upon which I return the promise from the function I cant figure it out :-/ – Misha Shblin Oct 26 '14 at 14:54