Skip to content

Commit

Permalink
spt: rename debounce constant
Browse files Browse the repository at this point in the history
  • Loading branch information
retrofox committed Feb 27, 2020
1 parent 765e3a7 commit f804fe3
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import { Disabled } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
/* eslint-enable import/no-extraneous-dependencies */

const THRESHOLD_RESIZE = 300;
// Debounce time applied to the on resize window event.
const DEBOUNCE_TIMEOUT = 300;

/**
* Copies the styles from the provided src document
Expand Down Expand Up @@ -161,7 +162,7 @@ const BlockFramePreview = ( {

// Handling windows resize event.
useEffect( () => {
const refreshPreview = debounce( rescale, THRESHOLD_RESIZE );
const refreshPreview = debounce( rescale, DEBOUNCE_TIMEOUT );
window.addEventListener( 'resize', refreshPreview );

return () => {
Expand Down

0 comments on commit f804fe3

Please sign in to comment.