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

149
Views
make yield put blocking in redux react

I am working on a react app where I want to block the execution at yield put and only resumes after yield put is completed.How can I do it in redux react?

yield put(ActionCreator.setPageNumber(page_number + 1));

I have to implement a functionality of table scroller which increments page number every time and then makes the api call with the updated page number,the above yield put increments the page number but as yield put is non-blocking in nature,api call doesnt wait for the page increment and makes the api call with the non incremented page number.

Any leads would definitely help!

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

0

You can add a separate saga watcher with take which is a blocking effect

export default function* TableScrollerSagaWatcher() {
  yield take('INCREMENT_PAGE_NUMBER_SUCCESS',tableScroller)
 /*
    assuming INCREMENT_PAGE_NUMBER_SUCCESS is the action type dispatched from the put call & tableScroller is the saga worker which would make the api call.*/
}

const tableScroller  = function*(){
    yield select() // select the page number from the store
    yield call() // make api call
 }
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!