@thinice/throttle
v0.1.0
Published
Throttle a function - executes at most once per interval
Readme
@thinice/throttle
Throttle a function - executes at most once per interval.
Installation
npm install @thinice/throttleUsage
import { throttle } from "@thinice/throttle";
const onScroll = throttle(() => {
console.log("scroll position:", window.scrollY);
}, 100);
window.addEventListener("scroll", onScroll);Source
https://github.com/thinicejs/utils/tree/main/packages/throttle
