Explorar o código

chore: changesets

Sven hai 1 ano
pai
achega
18590229c8
Modificáronse 2 ficheiros con 14 adicións e 1 borrados
  1. 13 0
      .changeset/hot-wolves-jog.md
  2. 1 1
      .changeset/tender-zoos-fix.md

+ 13 - 0
.changeset/hot-wolves-jog.md

@@ -0,0 +1,13 @@
+---
+"@sv443-network/userutils": major
+---
+
+`onSelector()` has been turned into the `SelectorObserver` class to reduce the performance impact on larger sites:
+- its instances can be scoped to any element lower in the DOM tree, not exclusively the entire body and all its children like before
+- separate instances can be disabled and reenabled individually on demand
+- separate instances can have different MutationObserver options set to further reduce performance impact
+- every listener can have a debounce time, so that it doesn't get called too often
+- there are now multiple methods to get and remove specific listeners
+  
+The `SelectorObserver.addListener()` method is backwards compatible with the old `onSelector()` function, so you can just add the class instance in front (for full backwards compat use `document.body` for the baseElement parameter), then change the old function's name and it should work as before.  
+For more info and examples, please view the [SelectorObserver documentation](https://github.com/Sv443-Network/UserUtils/blob/main/README.md#selectorobserver)  

+ 1 - 1
.changeset/tender-zoos-fix.md

@@ -2,4 +2,4 @@
 "@sv443-network/userutils": patch
 ---
 
-Add @linkcode references to the JSDoc in-IDE documentation
+Add `@linkcode` references to the JSDoc in-IDE documentation