diff --git a/docs/src/kolibri/observable.js b/docs/src/kolibri/observable.js index 09cc59c4..16de55d3 100644 --- a/docs/src/kolibri/observable.js +++ b/docs/src/kolibri/observable.js @@ -4,11 +4,13 @@ import { LOG_CONTEXT_KOLIBRI_BASE } from "./logger/logConstants.js"; export {Observable, ObservableList} -const { warn } = LoggerFactory(LOG_CONTEXT_KOLIBRI_BASE + ".observable"); - +let warn = undefined; /** @private */ function checkWarning(list) { if (list.length > 100) { + if (!warn) { + warn = LoggerFactory(LOG_CONTEXT_KOLIBRI_BASE + ".observable").warn; + } warn(`Beware of memory leak. ${list.length} listeners.`); } }