« All deprecation guides
Deprecation Guide for Ember.merge
until: 4.0.0
id: ember-polyfills.deprecate-merge
Ember.merge
predates Ember.assign
, but since Ember.assign
has been released, Ember.merge
has been mostly unnecessary.
To cut down on duplication, we are now recommending using Ember.assign
instead of Ember.merge
. If you need to support
Ember <= 2.4 you can use ember-assign-polyfill to make Ember.assign
available to you.
Before:
import { merge } from '@ember/polyfills';
var a = { first: 'Yehuda' };
var b = { last: 'Katz' };
merge(a, b); // a == { first: 'Yehuda', last: 'Katz' }, b == { last: 'Katz' }
After:
import { assign } from '@ember/polyfills';
var a = { first: 'Yehuda' };
var b = { last: 'Katz' };
assign(a, b); // a == { first: 'Yehuda', last: 'Katz' }, b == { last: 'Katz' }