I have this code that returns a Promise as i see in the browser
const data2 = fetchCurrentWeatherID({
params: {id: data.id - 3204, appid: 'ebc8de08ce3579cf444b51c12772a8bc'},
})
console.log(data2)
The result in the browser is:
↓Promise {<pending>}
→[[Prototype]]: Promise
[[PromiseState]]: "rejected"
→[[PromiseResult]]: Error: Request failed with status code 404 at createError (http://localhost:3000/vendors~main.8c0082efa14d3f9d53ec.hot-update.js:767:15) at settle (http://localhost:3000/vendors~main.8c0082efa14d3f9d53ec.hot-update.
in case the Promise is resolved the result is:
↓Promise {<pending>}
→[[Prototype]]: Promise
[[PromiseState]]: "fulfilled"
→[[PromiseResult]]: Object
I would like to access the PromiseState and the PromiseResult! I have made this API call with React.js