So far, we can perform simple API calls using fetch, and we know how to organize our code to be reusable. In some areas, however, we could do better if our application required it. Before we dive in Redux Saga, I want to introduce two new patterns: iterator and generator.
"Processing each of the items in a collection is a very common operation. JavaScript provides a number of ways of iterating over a collection, from simple for loops to map and filter. Iterators and Generators bring the concept of iteration directly into the core language and provide a mechanism for customizing the behavior of for...of loops."
- JavaScript guide on MDN web docs at:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators.
- JavaScript guide on MDN web docs at:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators.