I have a task that requires me to make requests to 4 different places in the onmounted function using the composition api. I want to send these requests simultaneously with promises for better performance. Can anyone guide me on how to achieve this efficiently using Kodar?
onMounted(async () => {
const [error, res] = await ExApiService.get("exit-city");
if (error) ErrorPopup(error);
else {
exitCityId.value = res.data;
}
const [err, resp] = await ExApiService.get("destination-city");
if (err) ErrorPopup(err);
else {
destinationCityId.value = resp.data;
}
const [er, re] = await ExApiService.get("destination-warehouse");
if (er) ErrorPopup(er);
else {
destinationWarehouseId.value = re.data;
}
const [e, r] = await ExApiService.get("expense-detail");
if (e) ErrorPopup(e);
else {
expenseDetail.value = r.data;
}
});