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

Function evaluate

packages/shared/src/features/monetization/useVisibleTime.ts:82–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80 };
81
82 const evaluate = () => {
83 const isVisible = meetsRatio && isPageInFocus();
84
85 if (isVisible && visibleSince === undefined) {
86 visibleSince = Date.now();
87 timer = setTimeout(tick, reportInterval);
88 } else if (!isVisible && visibleSince !== undefined) {
89 stopTimer();
90 report();
91 visibleSince = undefined;
92 }
93 };
94
95 const observer = new IntersectionObserver(
96 (entries) => {

Callers 1

useVisibleTimeFunction · 0.70

Calls 4

isPageInFocusFunction · 0.90
nowMethod · 0.80
stopTimerFunction · 0.70
reportFunction · 0.70

Tested by

no test coverage detected