I'm trying to get info from this promise, and store the values into a variable that I can use anywhere
Here's the function that returns the promise
const getInfo = async () => {
let info;
await Promise.all([new myApi().getTiers()])
.then(([apiResponse]) => {
info = apiResponse;
}).catch(error => {(
console.log(error))
});
return info;
}
Now in a different function, the furthest I've gotten is
const export myInfo () => {
getInfo().then(r => console.log(r))
}
This isn't really useful to me as r
is an array that I need to manipulate. I also can't make myInfo an async function as it's in a react component
Everything else I try just reusults into Promise<pending>