@tempots/dom

emitPreventDefault() function

Wraps a function to prevent the default behavior of an event before invoking it.

Signature:

emitPreventDefault: (fn: () => void) => (event: Event) => void

Parameters

Parameter

Type

Description

fn

() => void

The function to be wrapped.

Returns: (event: Event) => void

A new function that prevents the default behavior of the event and then invokes the original function.