@lijuhong1981/jsevents 1.1.4 → 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 +2 -2
- package/src/EventDispatcher.js +9 -1
- package/src/EventEmitter.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lijuhong1981/jsevents",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "lijuhong1981",
|
|
6
6
|
"homepage": "https://github.com/lijuhong1981/jslibs#readme",
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"@lijuhong1981/jscheck": "^1.0.9",
|
|
23
23
|
"@lijuhong1981/jsdestroy": "^1.1.9"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "e3683120a770680b5d16ff049baaafd4f58964fa"
|
|
26
26
|
}
|
package/src/EventDispatcher.js
CHANGED
|
@@ -109,7 +109,7 @@ class EventDispatcher extends Destroyable {
|
|
|
109
109
|
* @param {String|Object} type 事件类型
|
|
110
110
|
* @returns {Number} 监听器数量
|
|
111
111
|
*/
|
|
112
|
-
|
|
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 事件类型
|
package/src/EventEmitter.js
CHANGED