# evdelegate

> delegate events from document.body

Latest version **0.0.4** (published 2023-10-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install evdelegate
pnpm add evdelegate
yarn add evdelegate
bun add evdelegate
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2023-10-27 |
| First published | 2017-10-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | bumblehead |
| Keywords | delegation, delegate, event |

## Links

- npm: https://www.npmjs.com/package/evdelegate
- Repository: https://github.com/iambumblehead/evdelegate
- Homepage: https://github.com/iambumblehead/evdelegate#readme
- Issues: https://github.com/iambumblehead/evdelegate/issues
- npm.io page: https://npm.io/package/evdelegate

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 0.0.4 (latest) — 2023-10-27
- 0.0.3 — 2017-11-03
- 0.0.1 — 2017-10-20

## README

evdelegate
==========
**(c)[Bumblehead][0]**

delegate events from document.body

``` javascript
import evdel from 'evtdelegator';

const delegator = evdel.create();

evtdelegator.lsnpub({}, body, [
  'touchend',
  'click'
], (cfg, e) => {
  let delegatorstate = evdel.getactivestate(delegator);
  console.log('click', delegatorstate);

  if (delegatorstate) {
    e.preventDefault();
    console.log('delegate click', delegatorstate);
  }
});

// associate 'elem' with the touchend and click dispatcher above
delegator = evdel.addelemstate(delegator, elem, cfg);
```


[0]: http://www.bumblehead.com                            "bumblehead"

![scrounge](https://github.com/iambumblehead/scroungejs/raw/main/img/hand.png)

(The MIT License)

Copyright (c) [Bumblehead][0] <chris@bumblehead.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

---
_Source: https://npm.io/package/evdelegate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
