GitHub release GitHub issues GitHub last commit Github file size Build Status npm npm Analytics Greenkeeper badge

Debounce

Debounce multiple function executions

Install

npm i @three11/debounce

or

yarn add @three11/debounce

or

Just download this repository and link the files located in dist folder:

<script src="path-to-debounce/dist/debounce.min.js"></script>

or

Include it from Unpkg CDN

<script src="//unpkg.com/@three11/debounce/dist/debounce.min.js"></script>

Usage

First, import the module:

import debounce from '@three11/debounce';

Then use it to postpone a function's execution:

debounce(yourAwesomeFn());

Arguments

debounce(fn, wait, immediate) accepts three arguments:

  • fn : the function to debounce
  • wait : miliseconds to wait before running the fn again
  • immediate : whether the function should run immediately

License

GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007