Skip to content

Commit

Permalink
fix: remove tryInvoke usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Gorzas committed May 10, 2023
1 parent 5228409 commit b5ec052
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions addon/mixins/resize-aware.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import Mixin from '@ember/object/mixin';
import { inject as service } from '@ember/service';
import { get, setProperties } from '@ember/object';
import { debounce, next, scheduleOnce } from '@ember/runloop';
import { tryInvoke } from '@ember/utils';
import Ember from 'ember';

export default Mixin.create({
Expand Down Expand Up @@ -37,7 +36,7 @@ export default Mixin.create({
const newHeight = Math.floor(boundingRect.height);

if ((get(this, '_previousWidth') !== newWidth) || (get(this, '_previousHeight') !== newHeight)) {
next(this, () => !get(this, 'isDestroyed') && tryInvoke(this, 'didResize', [newWidth, newHeight]));
next(this, () => !get(this, 'isDestroyed') && this.didResize?.(newWidth, newHeight));
setProperties(this, {
_previousWidth: newWidth,
_previousHeight: newHeight
Expand Down

0 comments on commit b5ec052

Please sign in to comment.