Last active
January 25, 2019 16:58
-
-
Save brookslybrand/3563e9942f51b1cd9fe16d2b3cecdd0c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // sets the name in the store and in the state hook | |
| const setName = id => value => { | |
| // update the store | |
| db.formData.put({ id, value }) | |
| // update the state hook | |
| setNames(prevNames => ({ ...prevNames, [id]: value })) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment