bfx-api-node-core
Advanced tools
Comparing version 1.5.4 to 1.5.5
@@ -251,3 +251,4 @@ 'use strict' | ||
plugins: this.plugins, | ||
authArgs: this.authArgs | ||
authArgs: this.authArgs, | ||
autoResubscribe: this.autoResubscribe | ||
}) | ||
@@ -254,0 +255,0 @@ |
@@ -18,4 +18,4 @@ 'use strict' | ||
const wsState = m.getWS(id) | ||
const { channels } = wsState | ||
const channelIds = Object.keys(channels) | ||
const { resubChannels } = wsState | ||
const channelIds = Object.keys(resubChannels) | ||
@@ -25,3 +25,3 @@ m.emit('ws2:reopen', { id }) | ||
channelIds.forEach(chanId => { | ||
const data = channels[chanId] | ||
const data = resubChannels[chanId] | ||
@@ -28,0 +28,0 @@ switch (data.channel) { |
@@ -30,3 +30,4 @@ 'use strict' | ||
transform, | ||
url = WS_URL | ||
url = WS_URL, | ||
autoResubscribe = true | ||
} = opts | ||
@@ -52,2 +53,3 @@ | ||
transform, | ||
autoResubscribe, | ||
agent, | ||
@@ -54,0 +56,0 @@ emit, |
@@ -8,3 +8,3 @@ 'use strict' | ||
module.exports = (state = {}) => { | ||
const { url, agent, ws: oldWS } = state | ||
const { url, agent, ws: oldWS, channels, autoResubscribe } = state | ||
@@ -25,4 +25,8 @@ if (oldWS && oldWS.readyState === WebSocket.OPEN) { | ||
...state, | ||
ws | ||
channels: {}, | ||
isOpen: false, | ||
authenticated: false, | ||
ws, | ||
...(autoResubscribe && { resubChannels: channels }) | ||
} | ||
} |
{ | ||
"name": "bfx-api-node-core", | ||
"version": "1.5.4", | ||
"version": "1.5.5", | ||
"description": "Core Bitfinex Node API", | ||
@@ -5,0 +5,0 @@ "engines": { |
92940
2870