decord/source/modules/icymi/useICYMIEmptyLoadingAnalytics.tsx
github-actions cd74c1f217 chore: update source for alpha 345.5
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9667_m.js (378 MB)
2026-09-05 10:56:28 +00:00

50 lines
1.7 KiB
TypeScript

// Module ID: 16488
// Function ID: 16489
// Name: useICYMIEmptyLoadingAnalytics
// Dependencies: [19, 8359, 2]
// Exports: useICYMIEmptyLoadingAnalytics
// Module 16488 (useICYMIEmptyLoadingAnalytics)
import closure_2 from "noop" /* 19 */;
const require = arg1;
let result = require("set").fileFinishedImporting("modules/icymi/useICYMIEmptyLoadingAnalytics.tsx");
export const useICYMIEmptyLoadingAnalytics = function useICYMIEmptyLoadingAnalytics(loading, isFocused) {
closure_0 = loading;
closure_1 = isFocused;
React = React.useRef(null);
const items = [loading, isFocused];
const effect = React.useEffect(() => {
if (isFocused) {
if (loading) {
const _Date = Date;
tmp2.current = Date.now();
const ICYMIAnalytics = loading(isFocused[1]).ICYMIAnalytics;
const result = ICYMIAnalytics.trackFeedEmptyLoadingSeen();
} else if (null != tmp2.current) {
const _Date2 = Date;
const diff = Date.now() - tmp2.current;
const ICYMIAnalytics2 = loading(isFocused[1]).ICYMIAnalytics;
const obj = { dwellTimeMs: null };
obj[0] = diff;
const result1 = ICYMIAnalytics2.trackFeedEmptyLoadingComplete(obj);
tmp2.current = null;
}
}
}, items);
const items1 = [isFocused];
const effect1 = React.useEffect(() => {
if (!isFocused) {
if (null != ref.current) {
const _Date = Date;
const diff = Date.now() - tmp.current;
const ICYMIAnalytics = loading(isFocused[1]).ICYMIAnalytics;
const obj = { dwellTimeMs: null };
obj[0] = diff;
const result = ICYMIAnalytics.trackFeedEmptyLoadingAbandoned(obj);
tmp.current = null;
}
}
}, items1);
};