Apologies if this question seems basic to you. I am still new to TypeScript and working with Promises. Despite searching on various platforms, I couldn't find a relevant solution. Can you assist me in receiving an array of objects instead of promises? Additionally, I would appreciate it if you could suggest some resources for learning React with TypeScript. Thank you in advance!
index.ts
interface IFetchLikes {
item_id: string;
likes: number;
}
const fetchLikes = async (): Promise<IFetchLikes[]> => {
const response = await axios.get<IFetchLikes[]>('https://us-central1-involvement-api.cloudfunctions.net/capstoneApi/apps/PmGqiCAY4CG3PZPHNcEG/likes');
return response.data;
};
console.log('Response: ', fetchLikes());