what is saga effects code example
Example: what is saga effects
function* gen() {
yield 1;
yield 2;
yield 3;
yield 4;
}
let myGenerator = gen();
console.log(myGenerator.next()); //{value: 1, done: false}
console.log(myGenerator.next()); //{value: 2, done: false}
console.log(myGenerator.next()); //{value: 3, done: false}
console.log(myGenerator.next()); //{value: 4, done: false}
console.log(myGenerator.next()); // {value: undefined, done: true}