function-batcher

1.0.1 • Public • Published

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

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i function-batcher

Weekly Downloads

5

Version

1.0.1

License

MIT

Unpacked Size

14.7 kB

Total Files

9

Last publish

Collaborators

  • chrisknowles