I have method which does some stuff and invokes a callback and after certain time it does the same.
var myFunction = function(callback){
setInterval(function(){
var stuff;
//do some stuff
callback(stuff)
}, 3000);
}
Can I change this to a promise function? If yes how will the user invoke the function? I am planning to use bluebird library.