Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

105
Views
TS error when filtering on results in Promise.allSettled from axios request

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.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Maybe use the type {[key:string]:string} or {status: string} so the filter can compare?

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!