Explorar el Código

ref: debugging stuff

Sv443 hace 1 año
padre
commit
652a5dd2e4
Se han modificado 1 ficheros con 8 adiciones y 0 borrados
  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;
+}