devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
35 lines (34 loc) • 1.09 kB
JavaScript
/**
* DevExtreme (renovation/utils/diagnostic.js)
* Version: 23.2.6
* Build date: Wed May 01 2024
*
* Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
;
exports.DiagnosticUtils = void 0;
var _window = require("../../core/utils/window");
const DiagnosticUtils = {
resolveMap: () => {
const diagnosticWindow = (0, _window.getWindow)();
if (!diagnosticWindow.dxDiagnostic) {
diagnosticWindow.dxDiagnostic = {}
}
return diagnosticWindow.dxDiagnostic
},
getDiagnostic: key => {
const diagnosticMap = DiagnosticUtils.resolveMap();
if (!diagnosticMap[key]) {
diagnosticMap[key] = {
renderCount: 0
}
}
return diagnosticMap[key]
},
incrementRenderCount: key => {
const diagnostic = DiagnosticUtils.getDiagnostic(key);
diagnostic.renderCount += 1
}
};
exports.DiagnosticUtils = DiagnosticUtils;