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

Function subscribe

packages/shared/src/components/shell/useShellScroll.ts:75–88  ·  view source on GitHub ↗
(listener: () => void)

Source from the content-addressed store, hash-verified

73};
74
75const subscribe = (listener: () => void) => {
76 if (listeners.size === 0) {
77 lastY = window.scrollY;
78 window.addEventListener('scroll', onScroll, { passive: true });
79 }
80 listeners.add(listener);
81
82 return () => {
83 listeners.delete(listener);
84 if (listeners.size === 0) {
85 window.removeEventListener('scroll', onScroll);
86 }
87 };
88};
89
90// A thing's page keeps the block until its hero has gone and what docks
91// into the block (the name, Follow, the segments) has had room to arrive.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected