I have a function func
which resolves a promise and then tries to return the updated value of a local variable returnval
func: function(){
returnval = false;
var promise = new Ember.RSVP.Promise(function(resolve) {
// some stuff ..
returnval = true;
resolve();
});
promise.then(function(){
return returnval;
});
}
I guess the return returnval
returns from the promise object. How do I return the updated value of returnval
from the func
?