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

195
Views
Quiero usar efectos de saga en el método de clase.

Mi clase se ve así:

 abstract class Processor { canBeRun(action: RootActions, curOrderModal: OrderModalStep, curOrderPage: OrderPageStep): boolean { throw new Error('The method must override, canBeRun()'); } *_process(): Generator<any, any, any> { throw new Error('The method must override, _process()'); } } class OrignalMembersOrder extends Processor { constructor() { super(); } *_process(): Generator<any, any, any> { try { yield put(setCurOrderPage(OrderPageStep.original));// } catch (error) { console.log('error'); } } } export function* test(): Generator<any, any, any> { const Array: Processor[] = []; Array.push(new OrignalMembersOrder()); //Array.push(new OtherOrder...()); //Array.push(new OtherOrder...()); //Array.push(new OtherOrder...()); } Array.map((processors) => { processors._process().next(); });

y llamo al método _process().next(), no obtengo el resultado esperado...

Esta parte no funciona

 *_process(): Generator<any, any, any> { try { yield console.log("check") // success yield put(setCurOrderPage(OrderPageStep.original)); // failure } catch (error) { console.log('error'); } }

rendimiento console.log <- éxito

yield put(setCurOrderPage(OrderPageStep.original)) <- falla

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!