Skip to content

Instantly share code, notes, and snippets.

@tanner-west
Last active February 10, 2022 21:37
Show Gist options
  • Save tanner-west/1432f9d34caf331f2f3caaef07471f89 to your computer and use it in GitHub Desktop.
Save tanner-west/1432f9d34caf331f2f3caaef07471f89 to your computer and use it in GitHub Desktop.
function getTwoPlusTwo() {
return 2 + 2
}
function* mathSaga() {
const sum = yield getTwoPlusTwo()
console.log("two plus two equals: ", sum)
const sum2 = yield call(getTwoPlusTwo)
console.log("two plus two again equals: ", sum2)
}
// two plus two equals: 4
// two plus two again equals: 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment