debounce-promise:创建 Promise 返回函数的去抖动版本

时间:2021-08-05 03:02:42
【文件属性】:
文件名称:debounce-promise:创建 Promise 返回函数的去抖动版本
文件大小:44KB
文件格式:ZIP
更新时间:2021-08-05 03:02:42
JavaScript 去抖动承诺 创建 Promise 返回函数的去抖动版本 安装 npm i -S debounce-promise 使用示例 var debounce = require ( 'debounce-promise' ) function expensiveOperation ( value ) { return Promise . resolve ( value ) } var saveCycles = debounce ( expensiveOperation , 100 ) ; [ 1 , 2 , 3 , 4 ] . forEach ( num => { return saveCycles ( 'call no #' + num ) . then ( value => { console . log ( value ) } ) } ) // Will only c
【文件预览】:
debounce-promise-master
----.gitignore(41B)
----README.md(3KB)
----example.js(854B)
----test()
--------.eslintrc(64B)
--------.babelrc(90B)
--------index.js(5KB)
----LICENSE(1KB)
----package.json(1KB)
----.babelrc(35B)
----index.js(2KB)
----.eslintignore(4B)
----.npmignore(29B)
----.travis.yml(42B)
----package-lock.json(200KB)

网友评论