A custom Preact Hook that provides a declarative useEventListener.
npm install @preact-hooks/event> Inspired by donovan/use-event-listener
[![version][version-badge]][package]
[![MIT License][license-badge]][license]
A custom Preact Hook that provides a declarative useEventListener.
- Installation
- Docs
- LICENSE
This package has Preact 10+ as a peer dependency.
npm install @preact-hooks/event or yarn add @preact-hooks/event
You can also load it via the unpkg CDN
https://unpkg.com/@preact-hooks/event will download the latest UMD bundle.
For usage and examples see donovan/use-event-listener.
[package]: https://www.npmjs.com/package/@preact-hooks/event
[version-badge]: https://img.shields.io/npm/v/@preact-hooks/event
[license]: https://github.com/mihar-22/preact-hooks-event/blob/master/LICENSE
[license-badge]: https://img.shields.io/github/license/mihar-22/preact-hooks-event?color=b