@leafer/selector 1.0.0-beta.11 → 1.0.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/selector",
3
- "version": "1.0.0-beta.11",
3
+ "version": "1.0.0-beta.12",
4
4
  "description": "@leafer/selector",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -19,11 +19,11 @@
19
19
  "leaferjs"
20
20
  ],
21
21
  "dependencies": {
22
- "@leafer/event": "1.0.0-beta.11",
23
- "@leafer/math": "1.0.0-beta.11",
24
- "@leafer/list": "1.0.0-beta.11"
22
+ "@leafer/event": "1.0.0-beta.12",
23
+ "@leafer/math": "1.0.0-beta.12",
24
+ "@leafer/list": "1.0.0-beta.12"
25
25
  },
26
26
  "devDependencies": {
27
- "@leafer/interface": "1.0.0-beta.11"
27
+ "@leafer/interface": "1.0.0-beta.12"
28
28
  }
29
29
  }
package/src/FindPath.ts CHANGED
@@ -137,8 +137,7 @@ export class FindPath {
137
137
  }
138
138
 
139
139
  public destroy(): void {
140
- this.target = null
141
- this.selector = null
140
+ this.clear()
142
141
  }
143
142
 
144
143
  }
package/src/Selector.ts CHANGED
@@ -129,19 +129,17 @@ export class Selector implements ISelector {
129
129
 
130
130
  protected __removeListenEvents(): void {
131
131
  this.target.off_(this.__eventIds)
132
+ this.__eventIds.length = 0
132
133
  }
133
134
 
134
135
  public destroy(): void {
135
- if (this.target) {
136
+ if (this.__eventIds.length) {
136
137
  this.__removeListenEvents()
137
138
  this.findPath.destroy()
138
-
139
- this.target = null
140
- this.findPath = null
141
- this.innerIdList = null
142
- this.idList = null
143
- this.classNameList = null
144
- this.tagNameList = null
139
+ this.innerIdList = {}
140
+ this.idList = {}
141
+ this.classNameList = {}
142
+ this.tagNameList = {}
145
143
  }
146
144
  }
147
145