The Eric Normand Podcast cover image

What is a mutation function?

The Eric Normand Podcast

00:00

Mutation Functions and Update Ins

The mutation function takes the current pizza and an operation, you pass that to reduce as the reducing function. And now you can apply multiple operations in one go, basically. The reduce will do the work of returning the final version of the pizza after all those operations. This opens the door for stuff like event sourcing, where you don't keep the current value of the pizza, you keep an initial pizza and a list of all the operations done to it. That's really nice for doing undo and other UI niceties.

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app