Correctly remove reference to debounced updateSliderHeight method (https://github.com/woocommerce/woocommerce-admin/pull/4522)

This commit is contained in:
Jason Conroy 2020-06-09 11:39:43 +09:30 committed by GitHub
parent 69b11c30db
commit 9e03657451
1 changed files with 3 additions and 6 deletions

View File

@ -21,21 +21,18 @@ class Slider extends Component {
this.container = createRef();
this.onEnter = this.onEnter.bind( this );
this.updateSliderHeight = this.updateSliderHeight.bind( this );
this.debouncedUpdateSliderHeight = debounce( this.updateSliderHeight, 50 );
}
/**
* Update the slider height on Resize
*/
componentDidMount() {
// Update the slider height on Resize
window.addEventListener(
'resize',
debounce( this.updateSliderHeight, 50 )
);
window.addEventListener( 'resize', this.debouncedUpdateSliderHeight );
}
componentWillUnmount() {
window.removeEventListener( 'resize', this.updateSliderHeight )
window.removeEventListener( 'resize', this.debouncedUpdateSliderHeight );
}
updateSliderHeight() {