# encapsulation-debounce-throttle

> ``` npm i encapsulation-debounce-throttle yarn add encapsulation-debounce-throttle ``` ### 使用 ### 返回一个对象 main 引入需要结构化赋值 对象里面有 2 个函数 ``` //main 返回的对象 import main from 'encapsulation-debounce-throttle'; //结构赋值 {debounce(防抖的函数名称),throttle(节流的函数名称)} const

Latest version **1.1.5** (published 2022-08-31) · ISC license · 0 weekly downloads

## Install

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

## 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.1.5 |
| Published | 2022-08-31 |
| First published | 2022-08-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | yutao1 |

## Links

- npm: https://www.npmjs.com/package/encapsulation-debounce-throttle
- npm.io page: https://npm.io/package/encapsulation-debounce-throttle

## Recent versions

- 1.1.5 (latest) — 2022-08-31
- 1.1.4 — 2022-08-31
- 1.1.3 — 2022-08-31
- 1.1.2 — 2022-08-31
- 1.1.1 — 2022-08-31
- 1.1.0 — 2022-08-31
- 1.0.0 — 2022-08-31

## README

# 防抖和节流函数封装
### 下载
```
npm i encapsulation-debounce-throttle 
yarn add encapsulation-debounce-throttle
```
### 使用
### 返回一个对象 main 引入需要结构化赋值 对象里面有 2 个函数
``` 
//main 返回的对象
import  main from 'encapsulation-debounce-throttle';
//结构赋值 {debounce(防抖的函数名称),throttle(节流的函数名称)}
const { debounce ,throttle } = main
```
+ debounce 防抖函数
   + 接收两个参数:
   + func:函数
   + delay:时间 多久触发
   + 返回一个函数

+ throttle 节流函数
   + 接收两个参数:
   + time:时间 多久触发,
   + fun:函数
   + 返回一个函数

# Anti shake and throttle function encapsulation

### Return an object (main) to introduce, and structural assignment is required

### {debounce,throttle}
+ Debounce anti shake function
   + Receive two parameters:
   + Func: function
   + Delay: how long will it be triggered
   + Returns a function



+ Throttle function
   + Receive two parameters:
   + Time: how long is the trigger time,
   + Fun: functio
   + Returns a function

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