@aicacia/debounce

debounce

Usage no npm install needed!

<script type="module">
  import aicaciaDebounce from 'https://cdn.skypack.dev/@aicacia/debounce';
</script>

README

ts-debounce

license docs npm (scoped) build

debounce

import { debounce } from "@aicacia/debounce";

let count = 0;

const func = debounce(
  () => {
    console.log(count); // 1
  },
  100,
  {
    after() {
      count -= 1;
      console.log(count); // 0
    },
    before() {
      count += 1;
    },
  }
);

func();
console.log(count); // 1