MCPcopy Create free account
hub / github.com/dailydotdev/apps / onScroll

Function onScroll

packages/shared/src/hooks/useScrollTopOffset.ts:26–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24 }
25
26 const onScroll = () => {
27 let scrollValue = document.documentElement.scrollTop;
28
29 if (scrollProperty === 'scrollY') {
30 scrollValue = 'scrollY' in element ? element.scrollY : window.scrollY;
31 } else if ('scrollTop' in element) {
32 scrollValue = element.scrollTop;
33 }
34
35 const command = scrollValue > offset ? onOverOffset : onUnderOffset;
36 command();
37 };
38
39 element.addEventListener('scroll', onScroll);
40

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected