Bind a function to the resize event on window with an automatic default delay.

Parameters:
NameTypeDescription
fnfunction

The function to run on resize.

waitnumber

The delay for the debouncing of the resize event.

addboolean

Whether to add or remove the listener.

Since
  • 1.0.0
Returns:
Type: 
void
Example
import { resize } from "@gravityforms/utils";

function Example() {
    // do something on resize
};

resize( Example, 400 );

Requires