# prevent-jitter

> 把多次函数调用合并成一次，可以用于防止快捷按键、快速拖动窗口大小，解决导致事件处理函数内的复杂操作重复被执行

Latest version **1.0.1** (published 2022-02-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install prevent-jitter
pnpm add prevent-jitter
yarn add prevent-jitter
bun add prevent-jitter
```

## 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 | 1.0.1 |
| Published | 2022-02-16 |
| First published | 2022-02-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | lxf |
| Maintainers | iien21 |
| Keywords | 防抖, 重复触发, 滚动、改变窗口重复触发 |

## Links

- npm: https://www.npmjs.com/package/prevent-jitter
- npm.io page: https://npm.io/package/prevent-jitter

## Recent versions

- 1.0.1 (latest) — 2022-02-16

## README

## 防抖：把多次函数调用合并成一次，可以用于防止快捷按键、快速拖动窗口大小，导致事件处理函数内的复杂操作重复被执行多次降低用户体验

## 使用方法

```

  import { debounce } from "prevent-jitter";

  function ajax(content) {
    console.log("ajax request " + content);
  }

  debounce(ajax,1000)
  let debounceFun = debounce(ajax);

  //方法一
  onClick={()=>debounceFun('/user')}

  //方法二
  window.addEventListener("scroll", () => debounceFun());

  //方法三
  document.onmouseover=debounceFun(ajax)

```

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