clone: use new diff parsing to update children faster if only dynamic props change
This commit is contained in:
parent
b52e72f311
commit
a33751a800
1 changed files with 14 additions and 10 deletions
|
|
@ -203,21 +203,25 @@ class Clone extends Container {
|
|||
childrenChanged = false
|
||||
|
||||
var delta = diff.diff(clone.props, data) || {},
|
||||
[widget, props] = diffToWidget(clone, delta),
|
||||
changedProps = Object.keys(delta)
|
||||
[widget, patch] = diffToWidget(clone, delta),
|
||||
changedProps = Object.keys(patch)
|
||||
|
||||
if (changedProps.length) {
|
||||
|
||||
diff.patch(widget.props, patch)
|
||||
|
||||
|
||||
clone.props = data
|
||||
console.log(widget, props)
|
||||
if (props.some(x => !widget.constructor.dynamicProps.includes(x))) {
|
||||
if (changedProps.some(x => !widget.constructor.dynamicProps.includes(x))) {
|
||||
|
||||
clone.reCreateWidget({reuseChildren: false})
|
||||
this.updateContainer(false)
|
||||
clone.reCreateWidget({reuseChildren: false})
|
||||
this.updateContainer(false)
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
widget.updateProps(props, this)
|
||||
this.updateContainer(true)
|
||||
widget.updateProps(changedProps, this)
|
||||
this.updateContainer(true)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue