Answer the question
In order to leave comments, you need to log in
One nodejs module uses a promise, but why does a promise return a Promise { }?
var start = function(id,fields) {
return VK.call('friends.get', {
user_id: id,
fields: fields
})
.then(response => {
return _.filter(response.items, items => {
return items.online === 1
})
})
.catch(e => console.log(e))
}
start();
I expect it to return a response object, but it doesn't. Promise { <pending> }
Is this a feature of promises, or is the code written this way? https://github.com/olnaz/node-vkapi
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question