As humans, we crave for the connection of others, whether we realize it or not. As writers and content creators people want attention, they want to be noticed. At some point along the way many of us lost the desire to output authentic content, we stopped telling stories from the heart. Instead we began selling stories. We try to provide a catchy title in order to grab a potential reader’s attention, yet mostly have no real substance.
Generator are special functions that are new with ES6 / EcmaScript2015. Simply put, a Generator is a function whose execution is “pause-able and resume-able” meaning that it is not “run-to-completion”. This allows us to do some really cool things!
In order to define a generator function we use the function* syntax, like so:
One way to manage asynchronous behavior that is often considered to be a leveled up version of the callback pattern is the Promise pattern.
Promises are not a new concept. In fact, they have been around since 1976, when the term was first coined.
Software Engineer @ Google