Considering the example:
function returnValue () {
return somePromise.then (
function (someThing) {
return {
sucess: true,
data: someThing
}
},
function (someError) {
return {
sucess: false,
data: someError
}
}
)
}
Console.log (returnValue ())
What should I do so that I actually have "someThing" or "someError"? And not a Promise pending?
Just to note ... when I write a code like this within "Meteor.methods" it works exactly as I would like, that is, it returns a value that I return to the client, but outside of "Meteor.methods" or in the client (browser, using or not any framework) the one I have is a Promise pending.