I am working to implement my own Chrome Plugin. I have created a fetch function which should return JSON from the API. However it return a promise object with status of resolved and values. I am trying to just get plain JSON object out of API with fetch.
class _UTILS {
static getContent(path) {
const data = fetch(path)
.then((response) => {
return response.json().then((json) => {
return json;
})
}).catch((err) => {
console.log("Request Problem: ", err);
});
console.log(data);
}
}