Skip to content

Commit

Permalink
Remove unnecessary option copying
Browse files Browse the repository at this point in the history
  • Loading branch information
snowteamer committed Feb 28, 2021
1 parent bdf4d75 commit f875568
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions backend/utils/pubsub.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ export function createServer (httpServer: Object, options?: Object = {}): Object
...options,
server: httpServer
})
server.customClientHandlers = { ...options.clientHandlers }
server.customServerHandlers = { ...options.serverHandlers }
server.customClientHandlers = options.clientHandlers || {}
server.customServerHandlers = options.serverHandlers || {}
server.messageHandlers = { ...defaultMessageHandlers, ...options.messageHandlers }
server.pingInterval = undefined
server.subscribersByContractID = Object.create(null)
Expand Down
2 changes: 1 addition & 1 deletion shared/pubsub.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const RESPONSE_TYPE = Object.freeze({
*/
export function createClient (url: string, options?: Object = {}): PubSubClient {
const client = {
customHandlers: { ...options.handlers },
customHandlers: options.handlers || {},
failedAttempts: 0,
isReconnecting: false,
listeners: Object.create(null),
Expand Down

0 comments on commit f875568

Please sign in to comment.