JS: Add some more canonical event names as alternatives.

Most JS events are infinitive, not past tense, e.g. DOM events "click",
"mouseover", "load" and Node.js events "connect", "close".
This commit is contained in:
Stefan Thomas
2013-02-12 18:54:45 +01:00
parent 5942f2dd9f
commit 8a4820cf34

View File

@@ -348,11 +348,13 @@ Remote.prototype._set_state = function (state) {
switch (state) {
case 'online':
this._online_state = 'open';
this.emit('connect');
this.emit('connected');
break;
case 'offline':
this._online_state = 'closed';
this.emit('disconnect');
this.emit('disconnected');
break;
}