Simplify Immer Producer Functions using Currying

Share this video with your friends

Send Tweet

Once we’ve written a bunch of producer functions, we quickly discover a recurring pattern: In practice producers can be defined purely in terms of the draft (and any remaining arguments). Therefor we can factor out the function nesting by leveraging currying. We will also look at the “original” function.