1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
var Emitter, array;
array = require('./array');
module.exports = Emitter = (function() {
function Emitter() {
this._listeners = {};
this._listenersForAnyEvent = [];
this._disabledEmitters = {};
}
Emitter.prototype.on = function(eventName, listener) {
if (this._listeners[eventName] == null) {
this._listeners[eventName] = [];
}
this._listeners[eventName].push(listener);
return this;
};
Emitter.prototype.once = function(eventName, listener) {
var cb, ran;
ran = false;
cb = (function(_this) {
return function() {
if (ran) {
return;
}
ran = true;
listener();
return setTimeout(function() {
return _this.removeEvent(eventName, cb);
}, 0);
};
})(this);
this.on(eventName, cb);
return this;
};
Emitter.prototype.onAnyEvent = function(listener) {
this._listenersForAnyEvent.push(listener);
return this;
};
Emitter.prototype.removeEvent = function(eventName, listener) {
if (this._listeners[eventName] == null) {
return this;
}
array.pluckOneItem(this._listeners[eventName], listener);
return this;
};
Emitter.prototype.removeListeners = function(eventName) {
if (this._listeners[eventName] == null) {
return this;
}
this._listeners[eventName].length = 0;
return this;
};
Emitter.prototype.removeAllListeners = function() {
var listeners, name, _ref;
_ref = this._listeners;
for (name in _ref) {
listeners = _ref[name];
listeners.length = 0;
}
return this;
};
Emitter.prototype._emit = function(eventName, data) {
var listener, _i, _j, _len, _len1, _ref, _ref1;
_ref = this._listenersForAnyEvent;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
listener = _ref[_i];
listener.call(this, data, eventName);
}
if (this._listeners[eventName] == null) {
return;
}
_ref1 = this._listeners[eventName];
for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
listener = _ref1[_j];
listener.call(this, data);
}
};
Emitter.prototype._throttleEmitterMethod = function(fnName, time) {
var lastCallArgs, originalFn, pend, pending, runIt, timer;
if (time == null) {
time = 1000;
}
originalFn = this[fnName];
if (typeof originalFn !== 'function') {
throw Error("this class does not have a method called '" + fnName + "'");
}
lastCallArgs = null;
pending = false;
timer = null;
this[fnName] = (function(_this) {
return function() {
lastCallArgs = arguments;
return pend();
};
})(this);
pend = (function(_this) {
return function() {
if (pending) {
clearTimeout(timer);
}
timer = setTimeout(runIt, time);
return pending = true;
};
})(this);
return runIt = (function(_this) {
return function() {
pending = false;
return originalFn.apply(_this, lastCallArgs);
};
})(this);
};
Emitter.prototype._disableEmitter = function(fnName) {
if (this._disabledEmitters[fnName] != null) {
throw Error("" + fnName + " is already a disabled emitter");
}
this._disabledEmitters[fnName] = this[fnName];
return this[fnName] = function() {};
};
Emitter.prototype._enableEmitter = function(fnName) {
var fn;
fn = this._disabledEmitters[fnName];
if (fn == null) {
throw Error("" + fnName + " is not a disabled emitter");
}
this[fnName] = fn;
return delete this._disabledEmitters[fnName];
};
return Emitter;
})();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRW1pdHRlci5qcyIsInNvdXJjZVJvb3QiOiIuLlxcLi4iLCJzb3VyY2VzIjpbImNvZmZlZVxcbGliXFxFbWl0dGVyLmNvZmZlZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxJQUFBLGNBQUE7O0FFQUEsS0VBQSxHRUFRLE9FQUEsQ0VBUSxTRUFSLENBQVIsQ0FBQTs7QUVFQSxNRUFNLENFQUMsT0VBUCxHRUF1QjtBRUVULEVFQUEsaUJFQUEsR0VBQTtBRUVaLElFQUEsSUVBQyxDRUFBLFVFQUQsR0VBYyxFRUFkLENFQUE7QUVBQSxJRUVBLElFQUMsQ0VBQSxxQkVBRCxHRUF5QixFRUZ6QixDRUFB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