Created
April 26, 2020 12:00
-
-
Save Waltari10/14ec08fce46c6771bdecd0999263a8b6 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
... | |
const [henchmenState, dispatchHenchmen] = useReducer(henchmenReducer, initialHenchmenState); | |
... | |
const handleHenchmanChange = useCallback((henchman, id) => { | |
// handle modifying henchmen in reducer | |
dispatchHenchmen({ | |
type: actions.UPDATE, | |
payload: { | |
id, | |
henchman, | |
}, | |
}); | |
}, [dispatchHenchmen]); | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment