Skip to content

Commit

Permalink
Merge pull request #235 from iBotPeaches/defer-to-param
Browse files Browse the repository at this point in the history
fix: ensure passed param wins over global
  • Loading branch information
taylorotwell authored Jun 14, 2019
2 parents 997d8db + c7dba71 commit 5968b4b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/connector/socketio-connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ export class SocketIoConnector extends Connector {
* Get socket.io module from global scope or options.
*/
getSocketIO(): any {
if (typeof io !== 'undefined') {
return io;
}

if (typeof this.options.client !== 'undefined') {
return this.options.client;
}

if (typeof io !== 'undefined') {
return io;
}

throw new Error('Socket.io client not found. Should be globally available or passed via options.client');
}

Expand Down

0 comments on commit 5968b4b

Please sign in to comment.