Bind a function to the resize event on window with an automatic default delay.
Parameters:
Name | Type | Description |
---|---|---|
fn | function | The function to run on resize. |
wait | number | The delay for the debouncing of the resize event. |
add | boolean | Whether to add or remove the listener. |
- Since
- 1.0.0
- Source
Returns:
- Type:
- void
Example
import { resize } from "@gravityforms/utils";
function Example() {
// do something on resize
};
resize( Example, 400 );