Sometimes we want to update multiple properties. We can do this using the merge method.
merge
let baseButton = Immutable.Map({ 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 }
Last updated 5 years ago