Skip to content

Instantly share code, notes, and snippets.

@splincode
Created May 8, 2019 07:56
Show Gist options
  • Select an option

  • Save splincode/cc22bbfbbcab5b1ff8216abbec1faca9 to your computer and use it in GitHub Desktop.

Select an option

Save splincode/cc22bbfbbcab5b1ff8216abbec1faca9 to your computer and use it in GitHub Desktop.
data = {
...INITIAL_DATA,
items: {
...INITIAL_DATA.items,
[NEW_ITEM_ID]: { id: NEW_ITEM_ID, name: 'ITEM-NEW', value: 0 }
},
count: INITIAL_DATA.count +1,
keys: [ ...INITIAL_DATA.keys, NEW_ITEM_ID]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment