Skip to content

Commit 2cbbd0c

Browse files
committed
formatting
1 parent ee7a93e commit 2cbbd0c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/channel/socketio-channel.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class SocketIoChannel extends Channel {
113113
on(event: string, callback: Function): SocketIoChannel {
114114
this.listeners[event] = this.listeners[event] || [];
115115

116-
if (!this.events[event]) {
116+
if (! this.events[event]) {
117117
this.events[event] = (channel, data) => {
118118
if (this.name === channel && this.listeners[event]) {
119119
this.listeners[event].forEach((cb) => cb(data));
@@ -137,6 +137,9 @@ export class SocketIoChannel extends Channel {
137137
});
138138
}
139139

140+
/**
141+
* Unbind the listeners for the given event.
142+
*/
140143
protected unbindEvent(event: string, callback?: Function): void {
141144
this.listeners[event] = this.listeners[event] || [];
142145

@@ -147,6 +150,7 @@ export class SocketIoChannel extends Channel {
147150
if (!callback || this.listeners[event].length === 0) {
148151
if (this.events[event]) {
149152
this.socket.removeListener(event, this.events[event]);
153+
150154
delete this.events[event];
151155
}
152156

0 commit comments

Comments
 (0)