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

251
Vistas
Unexpected reserved word 'yield' in redux saga reactjs

I started with reactredux saga and this is my code for currentUserSaga.js.
currentUserSaga.js

import {delay} from 'redux-saga'
export function* currentUserSaga () {
    while(true){
        yield delay(1000);
        console.info("User Saga loop");
    }
}

While compiling I am getting following error.

SyntaxError: /home/Sakthy/Desktop/React Saga/redux-saga-cart/src/sagas/currentUserSaga.js: Unexpected reserved word 'yield' (4:8) 2 | export function currentUserSaga () { 3 |
while(true){> 4 | yield delay(1000); | ^ 5 |
console.info("User Saga loop"); 6 | } 7 | }

Please guide me I am following a tutorial but I think it's due to wrong use case of yield keyword.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

we expect generating functions to generate a value, and remember that the yield must return a value at each iterate, not a function that does not return anything.

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