@tlvince
2017-08-18
AKA dynamic object keys
Assigns new variables from object properties
Shallow-clones objects via:
Not yet formalised in ES spec!
shipments slice
api.saveChanges to update batch quantitiesstate was updated immutably with the parent shipment key omitted
const state = { shipmentA: {}, shipmentB: {} }
const parentDocId = 'shipmentA'
const { [parentDocId]: omit, ...nextState } = state
nextState
//=> { shipmentB: {}}Check with Babel REPL