Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

To claim this, I am signing this object:

// Say we have the below generator function
const generator = function * () {
try {
console.log("Now we're cooking with gas!!")
const thing = yield functionThatReturnsPromise()
// Promise resolved
console.log(`Yew! We did it! Here's the ${thing}!`)
} catch (error) {
// Promise rejected