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