@leafer/watcher
Advanced tools
+5
-5
| { | ||
| "name": "@leafer/watcher", | ||
| "version": "1.11.2", | ||
| "version": "1.12.0", | ||
| "description": "@leafer/watcher", | ||
@@ -25,9 +25,9 @@ "author": "Chao (Leafer) Wan", | ||
| "dependencies": { | ||
| "@leafer/event": "1.11.2", | ||
| "@leafer/data": "1.11.2", | ||
| "@leafer/list": "1.11.2" | ||
| "@leafer/event": "1.12.0", | ||
| "@leafer/data": "1.12.0", | ||
| "@leafer/list": "1.12.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@leafer/interface": "1.11.2" | ||
| "@leafer/interface": "1.12.0" | ||
| } | ||
| } |
+10
-8
@@ -23,3 +23,3 @@ import { ILeaf, IWatcher, IEventListenerId, ILeafList, IWatcherConfig } from '@leafer/interface' | ||
| public get updatedList(): ILeafList { | ||
| if (this.hasRemove) { | ||
| if (this.hasRemove && this.config.usePartLayout) { | ||
| const updatedList = new LeafList() | ||
@@ -63,3 +63,3 @@ this.__updatedList.list.forEach(item => { if (item.leafer) updatedList.add(item) }) | ||
| protected __onAttrChange(event: PropertyEvent): void { | ||
| this.__updatedList.add(event.target as ILeaf) | ||
| if (this.config.usePartLayout) this.__updatedList.add(event.target as ILeaf) | ||
| this.update() | ||
@@ -69,8 +69,10 @@ } | ||
| protected __onChildEvent(event: ChildEvent): void { | ||
| if (event.type === ChildEvent.ADD) { | ||
| this.hasAdd = true | ||
| this.__pushChild(event.child) | ||
| } else { | ||
| this.hasRemove = true | ||
| this.__updatedList.add(event.parent) | ||
| if (this.config.usePartLayout) { | ||
| if (event.type === ChildEvent.ADD) { | ||
| this.hasAdd = true | ||
| this.__pushChild(event.child) | ||
| } else { | ||
| this.hasRemove = true | ||
| this.__updatedList.add(event.parent) | ||
| } | ||
| } | ||
@@ -77,0 +79,0 @@ this.update() |
6427
2.21%126
1.61%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated