# throttled-event-listener

> Throttle or debounce calls to window.addEventListener(). The listener will additionally be throttled by window.requestAnimationFrame().

Latest version **0.0.3** (published 2016-08-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install throttled-event-listener
pnpm add throttled-event-listener
yarn add throttled-event-listener
bun add throttled-event-listener
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2016-08-08 |
| First published | 2016-06-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Vivek Maharajh |
| Maintainers | vivmaha |
| Keywords | throttle, debounce, interval, requestAnimationFrame, addEventListener, listener, animation, callback |

## Links

- npm: https://www.npmjs.com/package/throttled-event-listener
- Repository: https://github.com/vivmaha/throttled-event-listener
- Homepage: https://vivmaha.github.io/throttled-event-listener
- Issues: https://github.com/vivmaha/throttled-event-listener/issues
- npm.io page: https://npm.io/package/throttled-event-listener

## 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.3 (latest) — 2016-08-08
- 0.0.2 — 2016-08-08
- 0.0.1 — 2016-06-28

## README

# throttled-event-listener

Throttle or debounce calls to window.addEventListener(). The listener will additionally be throttled by window.requestAnimationFrame().

#[Demo](https://vivmaha.github.io/throttled-event-listener)

# Install

    $ npm install --save-dev throttled-event-listener

# Usage

## Throttle

    var throttler = require('throttled-event-listener');
    throttler.add(
        'scroll',
        1000,
        function(event) {
            // called a maximum of once per 1000ms
        }
    );

## Debounce

    throttler.add(
        'scroll',
        1000,
        function(event) {
            // waits for a cooldown period of 1000ms between calls
        }, {
            debounce : true,
        }
    );

## Stop throttle

    throttler.end();

# Build

    $ git clone ...
    $ npm install
    $ grunt serve

    // Deployed to http://localhost:9001/

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