Skip to content

Instantly share code, notes, and snippets.

@gearmobile
Created September 10, 2017 17:03
Show Gist options
  • Save gearmobile/12d13428fd17b61e0c91a8e2e709841b to your computer and use it in GitHub Desktop.
Save gearmobile/12d13428fd17b61e0c91a8e2e709841b to your computer and use it in GitHub Desktop.
Mutatiton for update existing object Meetup
'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