Created
September 10, 2017 17:03
-
-
Save gearmobile/12d13428fd17b61e0c91a8e2e709841b to your computer and use it in GitHub Desktop.
Mutatiton for update existing object Meetup
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
'UPDATE_MEETUP' (state, payload) { | |
const sample = state.meetups.find(el => el.id === payload.id) | |
if (sample) { | |
if (payload.title) { | |
sample.title = payload.title | |
} | |
if (payload.description) { | |
sample.description = payload.description | |
} | |
if (payload.date) { | |
sample.date = payload.date | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment