delegate node path removal to after call
This commit is contained in:
parent
5101664e7d
commit
5e0236d9a7
@ -57,8 +57,9 @@ export default class TraversalPath {
|
||||
}
|
||||
|
||||
setContext(parentPath, context, key) {
|
||||
this.shouldSkip = false;
|
||||
this.shouldStop = false;
|
||||
this.shouldRemove = false;
|
||||
this.shouldSkip = false;
|
||||
this.shouldStop = false;
|
||||
|
||||
this.parentPath = parentPath || this.parentPath;
|
||||
this.context = context;
|
||||
@ -70,6 +71,11 @@ export default class TraversalPath {
|
||||
}
|
||||
|
||||
remove() {
|
||||
this.shouldRemove = true;
|
||||
this.shouldSkip = true;
|
||||
}
|
||||
|
||||
_remove() {
|
||||
this._refresh(this.node, []);
|
||||
this.container[this.key] = null;
|
||||
this.flatten();
|
||||
@ -153,6 +159,10 @@ export default class TraversalPath {
|
||||
if (replacement) {
|
||||
this.node = replacement;
|
||||
}
|
||||
|
||||
if (this.shouldRemove) {
|
||||
this._remove();
|
||||
}
|
||||
}
|
||||
|
||||
isBlacklisted() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user