I have a Card class where I am calling an all()
function. I am doing a promise call inside it but I never get the result back. Any idea why?
class Card {
static all() {
this.getUsers().then((result) => {
console.log('result') // doesn't print
return result
})
}
get getUsers() {
return new Promise((resolve) => {
console.log('test')// doesn't print
chrome.storage.local.get({ user: [] }, function (result) {
chrome.storage.local.set({ user: [] }, () => { });
resolve(result.user);
});
});
}
}
let profile = new CardProfile(element).all()