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
}));