Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 419 Bytes

map_merge.md

File metadata and controls

21 lines (16 loc) · 419 Bytes

Map.merge

Sometimes we want to update multiple properties. We can do this using the merge method.

let baseButton = Immutable.Map<string, any>({
  text: 'Click me!',
  state: 'inactive',
  width: 200,
  height: 30
});

let submitButton = baseButton.merge({
  text: 'Submit',
  state: 'active'
});

console.log(submitButton);
// writes { text: 'Submit', state: 'active', width: 200, height: 30 }