batch-action:批处理项目并在批处理达到指定大小时执行操作

时间:2021-04-18 21:56:28
【文件属性】:
文件名称:batch-action:批处理项目并在批处理达到指定大小时执行操作
文件大小:56KB
文件格式:ZIP
更新时间:2021-04-18 21:56:28
JavaScript 批处理 批处理项目并在批处理达到指定大小时执行操作 例子 const Batch = require ( 'batch-action' ) ; function printMessage ( items ) { console . log ( `Received batch with ${ items . length } item(s)` ) ; } const batch = new Batch ( { size : 3 , // the action will be invoked every time 3 items are added action : printMessage , } ) ; batch . add ( 'a' ) ; batch . add ( 'b' ) ; batch . add ( 143 ) ; // Action gets invoked w
【文件预览】:
batch-action-master
----.eslintrc.json(253B)
----Batch.test.js(2KB)
----.github()
--------workflows()
----Batch.js(906B)
----LICENSE(1KB)
----.prettierrc(144B)
----README.md(2KB)
----.gitignore(22B)
----package-lock.json(232KB)
----package.json(858B)

网友评论