Sv443 1 год назад
Родитель
Сommit
652a5dd2e4
1 измененных файлов с 8 добавлено и 0 удалено
  1. 8 0
      lib/onSelector.ts

+ 8 - 0
lib/onSelector.ts

@@ -51,6 +51,9 @@ function checkSelectorExists<TElem extends Element = HTMLElement>(selector: stri
       console.error(`Couldn't call listener for selector '${selector}'`, err);
     }
   });
+
+  console.info("##-- opts", options, "\n##-- deleteIndices", deleteIndices, "\n##-- selectorMap", selectorMap.size, selectorMap);
+
   if(deleteIndices.length > 0) {
     const newOptsArray = options.filter((_, i) => !deleteIndices.includes(i));
     if(newOptsArray.length === 0)
@@ -79,3 +82,8 @@ export function initOnSelector(opts: InitOnSelectorOpts = {}) {
     childList: true,
   });
 }
+
+/** Returns all currently registered selectors, as a map of selector strings to their associated options */
+export function getSelectorMap() {
+  return selectorMap;
+}