Created
May 31, 2020 19:53
-
-
Save trblackw/cec2bea610cbfa6425a623c5a63fd888 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 produce from "immer" | |
const updateUsers = (state, confirmedUserId) => { | |
//users will be user state defined above | |
return produce(state, draft => { | |
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