# debounce-throttle-args

> debounce and throttle are easy use for parameter transfer,At the same time, using ‘this’ and ‘event’ is like using a callback function directly

Latest version **3.0.0** (published 2021-06-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install debounce-throttle-args
pnpm add debounce-throttle-args
yarn add debounce-throttle-args
bun add debounce-throttle-args
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2021-06-18 |
| First published | 2021-06-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | jianwei |
| Maintainers | alunotway |

## Links

- npm: https://www.npmjs.com/package/debounce-throttle-args
- Repository: https://github.com/AlunOtway/debounce-throttle-args
- Homepage: https://github.com/AlunOtway/debounce-throttle-args#readme
- Issues: https://github.com/AlunOtway/debounce-throttle-args/issues
- npm.io page: https://npm.io/package/debounce-throttle-args

## Recent versions

- 3.0.0 (latest) — 2021-06-18
- 2.0.0 — 2021-06-18
- 1.0.0 — 2021-06-18

## README

# debounce-throttle
If you want to use the debounce or throttling.
I'd be more than happy to introduce you to .
This tool not only supports parameter transfer, but also can customize the throttling threshold.
This encapsulation solves the of the this pointing problem and the parameter problem of the arguments


#Features 
- Support for parameter transfer
- Support for throttle value
- Use "this" and "envent" normally

#installation


    npm install debounce-throttle-args --save


#demo

**html**


    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>Title</title>
    </head>
    <body>
    <input class="debounce-button" type="button" value="debounce-按钮">
    <input class="throttle-button" type="button" value="throttle-按钮">
    </body>
    <script src="../dist/bundle.js"></script>
    </html>


**main.js**

You may use webpack or browserify to package it

Finally, convert to a 'bundlejs' that the browser can recognize

    let {debounce,throttle}  = require('debounce-throttle-args')
    document.querySelector(".debounce-button").addEventListener("click",debounce(handleClick,2000,"zhangsan","lisi"))
    
    document.querySelector(".throttle-button").addEventListener("click",throttle(handleClick,2000,"wangwu","zhaoliu"))
    
    function handleClick(name1,name2) {
    console.log(this)
    console.log(event)
    console.log(arguments)
    console.log(name1,name2)
    }

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