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

271
Views
How to make multiple api end point calls in sequential order with react redux javascript?

I have a redux store containing multiple states which is populated by same api but multiple end-points.

I have a react app with multiple components, which access to one of these states, and they all call to the correspondent api no mount by dispatching a async function (redux-thunk) to the store.

In the App.js multiple components are used.

Problem: When all the components mount they call to the api concurrently and exceeds the maximum number of call allowed for the short time frame. Thus all calls reply with status code 429: Too many request.

*Extra notes: I'm buliding a news web-app, and using gnews.io api with multiple search queries and end-points to get data.

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

0

In your case i believe one approach would be to create a request type and use it in your state instead of the raw value returned from the endpoint, something like:

type TApiRequestState<T> = {pending: boolean, response: T}

When you dispatch an action that will trigger the endpoint in thunks you would set the api state to loading. After that all you need to do is check if the request is not already running on the other components.

if (!value.pending && !value.response) {
   dispatch(thunksFn)
}

In theory you could dispatch all of the initial requests on a parent component and only render these child components when the initial requests are done. But this depends on a project to project basis IMO.

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!