@lijuhong1981/jsevents 1.1.3 → 1.1.5

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": "@lijuhong1981/jsevents",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "> TODO: description",
5
5
  "author": "lijuhong1981",
6
6
  "homepage": "https://github.com/lijuhong1981/jslibs#readme",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@lijuhong1981/jscheck": "^1.0.9",
23
- "@lijuhong1981/jsdestroy": "^1.1.8"
23
+ "@lijuhong1981/jsdestroy": "^1.1.9"
24
24
  },
25
- "gitHead": "611e658c8c0e2b72dbea60cbcd50ec6dc2d0b497"
25
+ "gitHead": "e3683120a770680b5d16ff049baaafd4f58964fa"
26
26
  }
@@ -109,7 +109,7 @@ class EventDispatcher extends Destroyable {
109
109
  * @param {String|Object} type 事件类型
110
110
  * @returns {Number} 监听器数量
111
111
  */
112
- getEventListenersCount(type) {
112
+ getListenersCount(type) {
113
113
  Check.valid('type', type);
114
114
 
115
115
  const listeners = this._listenersMap.get(type);
@@ -117,6 +117,14 @@ class EventDispatcher extends Destroyable {
117
117
  return listeners ? listeners.length : 0;
118
118
  }
119
119
 
120
+ /**
121
+ * @deprecated
122
+ */
123
+ getEventListenersCount(type) {
124
+ console.warn("The getEventListenersCount function has deprecated, use getListenersCount instead.");
125
+ return this.getListenersCount(type);
126
+ }
127
+
120
128
  /**
121
129
  * 判断是否已添加某类型的事件监听器
122
130
  * @param {String|Object} type 事件类型
@@ -57,7 +57,7 @@ class EventEmitter extends Destroyable {
57
57
  * @returns {Number} 监听器数量
58
58
  */
59
59
  listenersCount(type) {
60
- return this._dispatcher.getEventListenersCount(type);
60
+ return this._dispatcher.getListenersCount(type);
61
61
  }
62
62
 
63
63
  /**