Skip to content

Commit

Permalink
Merge pull request #206 from dcyriller/remove-deprecated-copy
Browse files Browse the repository at this point in the history
Cleanup usage of `copy`
  • Loading branch information
mike-north committed Jul 10, 2018
2 parents 8cfb657 + dacf83b commit 1963fc0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions addon/metrics-adapters/google-analytics.js
@@ -1,6 +1,5 @@
import { assign } from '@ember/polyfills';
import { isPresent } from '@ember/utils';
import { copy } from '@ember/object/internals';
import { assert } from '@ember/debug';
import { get } from '@ember/object';
import $ from 'jquery';
Expand All @@ -17,7 +16,7 @@ export default BaseAdapter.extend({
},

init() {
const config = copy(get(this, 'config'));
const config = assign({}, get(this, 'config'));
const { id, sendHitTask, trace, require } = config;
let { debug } = config;

Expand Down
4 changes: 2 additions & 2 deletions addon/metrics-adapters/segment.js
@@ -1,7 +1,7 @@
import $ from 'jquery';
import { assert } from '@ember/debug';
import { copy } from '@ember/object/internals';
import { get } from '@ember/object';
import { assign } from '@ember/polyfills';
import canUseDOM from '../utils/can-use-dom';
import { compact } from '../utils/object-transforms';
import BaseAdapter from './base';
Expand All @@ -12,7 +12,7 @@ export default BaseAdapter.extend({
},

init() {
const config = copy(get(this, 'config'));
const config = assign({}, get(this, 'config'));
const segmentKey = config.key;

assert(`[ember-metrics] You must pass a valid \`key\` to the ${this.toString()} adapter`, segmentKey);
Expand Down
3 changes: 1 addition & 2 deletions addon/services/metrics.js
Expand Up @@ -2,7 +2,6 @@ import { assign } from '@ember/polyfills';
import Service from '@ember/service';
import { assert } from '@ember/debug';
import { set, get, getWithDefault } from '@ember/object';
import { copy } from '@ember/object/internals';
import { A as emberArray, makeArray } from '@ember/array';
import { dasherize } from '@ember/string';
import { getOwner } from '@ember/application';
Expand Down Expand Up @@ -116,7 +115,7 @@ export default Service.extend({
const cachedAdapters = get(this, '_adapters');
const allAdapterNames = keys(cachedAdapters);
const [selectedAdapterNames, options] = args.length > 1 ? [makeArray(args[0]), args[1]] : [allAdapterNames, args[0]];
const context = copy(get(this, 'context'));
const context = assign({}, get(this, 'context'));
const mergedOptions = assign(context, options);

selectedAdapterNames
Expand Down

0 comments on commit 1963fc0

Please sign in to comment.