# seng-disposable-event-listener

> The DisposableEventListener is a wrapper around the native addEventListener method, which makes it easier to remove the handlers. By calling the returning function, the listener is removed

Latest version **2.0.1** (published 2020-05-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install seng-disposable-event-listener
pnpm add seng-disposable-event-listener
yarn add seng-disposable-event-listener
bun add seng-disposable-event-listener
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2020-05-08 |
| First published | 2018-07-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 9.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ricco Arntz |
| Maintainers | riccoarntz |
| Keywords | seng, mediamonks, boilerplate, seng-disposable-event-listener |

## Links

- npm: https://www.npmjs.com/package/seng-disposable-event-listener
- Repository: https://github.com/riccomediamonks/seng-disposable-event-listener
- Homepage: https://www.mediamonks.com/
- Issues: https://github.com/riccomediamonks/seng-disposable-event-listener/issues
- npm.io page: https://npm.io/package/seng-disposable-event-listener

## Dependencies (1)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.0.0-beta.35

## 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

- 2.0.1 (latest) — 2020-05-08
- 1.0.3 — 2018-07-11
- 1.0.2 — 2018-07-11

## README

# seng-disposable-event-listener
The addEventListener is a wrapper around the native addEventListener method, which makes it easier to remove it. By calling this function, the listener is removed

## Installation
### yarn / npm

```sh
yarn add seng-disposable-event-listener
```

```sh
npm i -S seng-disposable-event-listener
```

## Usage

#### Constructing.
```
  const windowResizeListener = addEventListener(
    window,
    resize',
    this.handleResize.bind(this)
  );
```

#### Disposing

```
  windowResizeListener();
```


## Building

In order to build seng-disposable-event-listener, ensure that you have [Git](http://git-scm.com/downloads) and [Node.js]
(http://nodejs
.org/) installed.

Clone a copy of the repo:
```sh
git clone https://github.com/riccomediamonks/seng-disposable-event-listener.git
```

Change to the seng-disposable-event-listener directory:
```sh
cd seng-disposable-event-listener
```

Install dev dependencies:
```sh
yarn
```

Use one of the following main scripts:
```sh
yarn build           # build this project
yarn dev             # run dev-watch mode, serving example/index.html in the browser
yarn generate        # generate all artifacts (compiles ts, webpack, docs and coverage)
yarn test:unit       # run the unit tests
yarn validate        # runs validation scripts, including test, lint and coverage check
yarn lint            # run tslint on this project
yarn doc             # generate typedoc documentation
```

When installing this module, it adds a pre-push hook, that runs the `validate`
script before committing, so you can be sure that everything checks out.

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