I am using axios and Promise.allSettled to make a number of API calls. I am also using TS in this project.
const settledResults = await Promise.allSettled([
axios.get("./one.json"),
axios.get("./two.json"),
]);
const fulfilledResults = settledResults.filter(result => result.status === 'fulfilled');
This line gives the following error, which I can fix by adding any:
settledResults.filter((result: any) => result.status === 'fulfilled');
Parameter 'result' implicitly has an 'any' type.
Has anyone got an idea what the type here should be?
Have tried AxiosResponse with Promises and anything else I could think of with no luck.
Maybe use the type {[key:string]:string} or {status: string} so the filter can compare?