I'm working with Bluebird for promises in Node.Js, and was wondering how can I make a function return when the promise is fulfilled(completed).The behavior I want is :
function getItem(){
functionReturningPromise.then(function(result){
//do some operation on result
return result;
});
}
However, the above implementation won't return anything since the promise isn't completed at the time of execution. What would be the best workaround around this?
The purpose of getItem is to modify whatever functionReturningPromise returns, and then return it