function-batcher
v1.0.1
Published
A simple utility for batch executing a group of functions
Downloads
9
Readme
Function Batcher
A simple utility for batch executing a group of functions.
Usage
// ES module is in /src/function-batcher.js
import FunctionBatcher from 'function-batcher'
<script type='text/javascript' src='/dist/function-batcher.js'></script>
<script type='text/javascript' src='/dist/function-batcher.min.js'></script>
function f() {
console.log(1)
}
function g() {
console.log(2)
}
batch = FunctionBatcher()
batch.add(f)
batch.add(g)
batch.run()
// => 1
// 2
batch.remove(f)
batch.run()
// => 2