Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Commit

Permalink
Cleanup usage of copy
Browse files Browse the repository at this point in the history
As it is deprecated.
More info here: https://github.com/emberjs/ember-copy
  • Loading branch information
dcyriller committed Jul 2, 2018
1 parent 8cfb657 commit dacf83b
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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 dacf83b

Please sign in to comment.