Created
May 31, 2020 20:05
-
-
Save trblackw/2c1842164a22ddd8198d5b3fb13fec47 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { produceWithPatches } from "immer" | |
const [nextState, patches, inversePatches] = produceWithPatches((draft, confirmedUserId) => { | |
draft[draft.findIndex(({ id }) => id === confirmedUserId)].emailConfirmed = true | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment