Skip to content

Add canBatch.debounce

Choose a tag to compare

@christopherjbaker christopherjbaker released this 10 Jul 20:41
· 54 commits to master since this release

Adds canBatch.debounce(fn), which provides an event listener which runs only once per batch.

Example

obj.on("event", canBatch.debounce(function() {
  // only runs once per batch
}));

canBatch.start();
obj.dispatch("event");
obj.dispatch("event");
canBatch.stop();