Generator functions are more flexible and can be used for yielding different things depending on the number of times it gets used. Pagination of some sort comes to my mind. Here are some examples of generator functions that would be trickier to implement using async/await:


'yield' will wait until generator is unrolled to this 'yield' iteration.

The idea of saga generator (worker) is to generate special functions (so called 'effects') using effect creators (put, call etc), not just do something. This allows to orchestrate function calls.

See also Redux Saga async/await pattern

Related Query

More Query from same tag