Changeset View
Changeset View
Standalone View
Standalone View
support/aphlict/server/lib/AphlictListenerList.js
| Show All 25 Lines | removeListener: function(listener) { | ||||
| var id = listener.getID(); | var id = listener.getID(); | ||||
| if (id in this._listeners) { | if (id in this._listeners) { | ||||
| delete this._listeners[id]; | delete this._listeners[id]; | ||||
| this._activeListenerCount--; | this._activeListenerCount--; | ||||
| } | } | ||||
| }, | }, | ||||
| getListeners: function() { | getListeners: function() { | ||||
| return this._listeners; | var keys = Object.keys(this._listeners); | ||||
| var listeners = []; | |||||
| for (var i = 0; i < keys.length; i++) { | |||||
| listeners.push(this._listeners[keys[i]]); | |||||
| } | |||||
| return listeners; | |||||
| }, | }, | ||||
| getActiveListenerCount: function() { | getActiveListenerCount: function() { | ||||
| return this._activeListenerCount; | return this._activeListenerCount; | ||||
| }, | }, | ||||
| getTotalListenerCount: function() { | getTotalListenerCount: function() { | ||||
| return this._totalListenerCount; | return this._totalListenerCount; | ||||
| Show All 13 Lines | |||||