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 };
