Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

150
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda