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