Skip to content

Commit

Permalink
fix: use spread operator instead of Ember.assign
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Oct 25, 2021
1 parent 6dcfd68 commit 136ca56
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions addon/helpers/page-title.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { inject as service } from '@ember/service';
import Helper from '@ember/component/helper';
import { guidFor } from '@ember/object/internals';
import { assign } from '@ember/polyfills';

/**
`{{page-title}}` helper used to set the title of the current route context.
Expand All @@ -23,10 +22,11 @@ export default class PageTitle extends Helper {
}

compute(params, _hash) {
let hash = assign({}, _hash, {
let hash = {
..._hash,
id: this.tokenId,
title: params.join(''),
});
};

this.tokens.push(hash);
this.tokens.scheduleTitleUpdate();
Expand Down
3 changes: 1 addition & 2 deletions addon/services/page-title-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { getOwner } from '@ember/application';
import { scheduleOnce } from '@ember/runloop';
import Service, { inject as service } from '@ember/service';
import { isEmpty } from '@ember/utils';
import { assign } from '@ember/polyfills';
import { assert } from '@ember/debug';

let isFastBoot = typeof FastBoot !== 'undefined';
Expand Down Expand Up @@ -164,7 +163,7 @@ export default class PageTitleListService extends Service {
}
let lastToken = group[0];
if (lastToken) {
token = assign({}, token);
token = { ...token };
token.separator = lastToken.separator;
}
group.unshift(token);
Expand Down

0 comments on commit 136ca56

Please sign in to comment.