For is faster

This commit is contained in:
Jiiks 2018-01-31 15:46:57 +02:00
parent 76730d38d4
commit 6b800d94e3
1 changed files with 7 additions and 4 deletions

View File

@ -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);
if (f) {
sub.callback(f);
continue;
}
} catch(err) {}
});
}
}
observe() {