diff --git a/src/carousel.ts b/src/carousel.ts index 80e2393aa2..956b40bbdf 100644 --- a/src/carousel.ts +++ b/src/carousel.ts @@ -240,10 +240,8 @@ export class Carousel extends Component { window.removeEventListener('resize', this._handleThrottledResize); } - _handleThrottledResize: () => void = Utils.throttle( - function () { - this._handleResize(); - }, + _handleThrottledResize = (): void => Utils.throttle( + this._handleResize, 200, null ).bind(this); diff --git a/src/scrollspy.ts b/src/scrollspy.ts index c682d1be07..47b7e58cbc 100644 --- a/src/scrollspy.ts +++ b/src/scrollspy.ts @@ -139,9 +139,7 @@ export class ScrollSpy extends Component { } } - _handleThrottledResize: () => void = Utils.throttle(function () { - this._handleWindowScroll(); - }, 200).bind(this); + _handleThrottledResize = (): void => Utils.throttle(this._handleWindowScroll, 200).bind(this); _handleTriggerClick = (e: MouseEvent) => { const trigger = e.target; diff --git a/src/tapTarget.ts b/src/tapTarget.ts index 8b099fe54c..6aabed3a1d 100644 --- a/src/tapTarget.ts +++ b/src/tapTarget.ts @@ -109,9 +109,7 @@ export class TapTarget extends Component implements Openable { window.removeEventListener('resize', this._handleThrottledResize); } - _handleThrottledResize: () => void = Utils.throttle(function () { - this._handleResize(); - }, 200).bind(this); + _handleThrottledResize = (): void => Utils.throttle(this._handleResize, 200).bind(this); _handleKeyboardInteraction = (e: KeyboardEvent) => { if (Utils.keys.ENTER.includes(e.key)) {