-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathonDomContentLoad.ts
More file actions
26 lines (19 loc) · 896 Bytes
/
onDomContentLoad.ts
File metadata and controls
26 lines (19 loc) · 896 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import {readJsonReportData as clientReadJsonReportData} from './readJsonReportData';
import {setDomElementsToClientState as clientSetDomElementsToClientState} from './setDomElementsToClientState';
import type {ReportClientState} from '../../../types/internal';
declare const reportClientState: ReportClientState;
const readJsonReportData = clientReadJsonReportData;
const setDomElementsToClientState = clientSetDomElementsToClientState;
/**
* `DOMContentLoaded` handler for report page.
* This client function should not use scope variables (except global functions).
* @internal
*/
export const onDomContentLoad = (): void => {
setDomElementsToClientState({afterDomContentLoad: true});
readJsonReportData(true);
for (const observer of reportClientState.readJsonReportDataObservers) {
observer.disconnect();
}
reportClientState.readJsonReportDataObservers.length = 0;
};