For is faster
This commit is contained in:
parent
76730d38d4
commit
6b800d94e3
|
@ -40,12 +40,15 @@ class DOMObserver {
|
||||||
}
|
}
|
||||||
|
|
||||||
observerCallback(mutations) {
|
observerCallback(mutations) {
|
||||||
this.subscriptions.forEach(sub => {
|
for (let sub of this.subscriptions) {
|
||||||
try {
|
try {
|
||||||
const f = mutations.find(sub.filter);
|
const f = mutations.find(sub.filter);
|
||||||
if (f) sub.callback(f);
|
if (f) {
|
||||||
|
sub.callback(f);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
} catch(err) {}
|
} catch(err) {}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
observe() {
|
observe() {
|
||||||
|
|
Loading…
Reference in New Issue