Skip to content

Commit 9409493

Browse files
author
ansuz
committed
Allow callbacks to shortcircuit diff application
return true from callback to break
1 parent e48b223 commit 9409493

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

diffDOM.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@
983983
node: node
984984
};
985985

986-
this.preVirtualDiffApply(info);
986+
if (this.preVirtualDiffApply(info)) { return true; }
987987

988988
switch (diff.action) {
989989
case 'addAttribute':
@@ -1156,7 +1156,7 @@
11561156
node: node
11571157
};
11581158

1159-
this.preDiffApply(info);
1159+
if (this.preDiffApply(info)) { return true; }
11601160

11611161
switch (diff.action) {
11621162
case 'addAttribute':
@@ -1250,6 +1250,7 @@
12501250
}
12511251

12521252
// if a new node was created, we might be interested in it
1253+
// post diff hook
12531254
info.newNode = newNode;
12541255
this.postDiffApply(info);
12551256

0 commit comments

Comments
 (0)