@stanfordspezi/spezi-web-design-system
Version:
Stanford Biodesign Digital Health Spezi Web Design System
16 lines (15 loc) • 346 B
JavaScript
import { useState as l, useEffect as t } from "react";
const c = (s) => {
const [r, o] = l(!1);
return t(() => {
const e = () => {
o(window.scrollY > s);
};
return e(), window.addEventListener("scroll", e, { passive: !0 }), () => {
window.removeEventListener("scroll", e);
};
}, [s]), r;
};
export {
c as u
};