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

83
Views
Periodic api requests in React?

Perhaps I'm asking a stupid thing, but I'm really interested to know how I can achieve periodic requests for the api, on my backend I implemented an endpoint that prepares data and sends it to AWS Lambda, where an excel file is prepared and sent back to the api, so, in while the file is being prepared, the object has the pending status, when Lambda returns the file, the status turns into a complete, when the user clicks the download button, the frontend should send requests with a timeout of 1.5 seconds to the api and watch the request status, how can I implement such a tool? below is an example of the code of two sagas, I thought that this could be implemented through them

  try {
    const payload = action.payload;
    if (payload.downloader) {
      const response = yield audienceApi.getAllUsers(payload.botId, payload.page, payload.downloader);
      if (response) {
        yield put(audienceActions.addOrUpdateReport(response));
        yield put(audienceActions.getAllUsersSuccess(response));

      }
    } else {
      let response = yield audienceApi.getAllUsers(payload.botId, payload.page);
      if (response) {
        yield put(audienceActions.getAllUsersSuccess(response));
      }
    }

  } catch (err) {}
}

function* addOrUpdateReportSaga(payload) {
  try {
    // if (payload.status === 'pending') {
      yield delay(1500);
      yield audienceApi.downloadPreparedFile(payload.file_id)
      // yield put(audienceActions.downloadPreparedFile(payload));
    // }
  } catch (err) {}
}```
about 4 years ago · Juan Pablo Isaza
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!