@jsxtools/prevent-default
v1.0.6
Published
Returns a function that will invoke preventDefault on any events passed into it.
Downloads
19
Readme
prevent-default
prevent-default returns a function that invokes preventDefault
on any event
passed into it.
It is 191 bytes (145 gzipped).
Installation
npm install @jsxtools/prevent-default
Usage
import preventDefault from '@jsxtools/prevent-default';
document.querySelector('form').addEventListener('submit', preventDefault(() => {
// handle submission via JS without submission
}));