UNPKG

@techmely/utils

Version:

Collection of helpful JavaScript / TypeScript utils

21 lines (18 loc) 391 B
import { isServer } from './chunk-ZVWX56RU.mjs'; // src/onScrollStop/index.ts function onScrollStop(callback, timeout = 150) { if (isServer()) return; let isScrolling; window.addEventListener( "scroll", () => { clearTimeout(isScrolling); isScrolling = setTimeout(() => { callback(); }, timeout); }, false ); } export { onScrollStop };