binance-api-node
binance-api-node copied to clipboard
Even after clean(), it will always return true
Hi, I am using version 0.11.40.
In my code, I tried https://github.com/ViewBlock/binance-api-node/issues/470
if(clean) clean(); Even after I cleaned the subscription, the clean still return true. Exclude the initial value of clean, it always return true, even after I run clean(); And fyi clean() successfully stopped the websocket.
How can I be sure that client.ws.ticker or client.ws.futuresUser websocket have stop running?
That's up to implementationt atm, but PR's are welcome. In the meantime I've been doing it something like so :
const userMsgHandler = update => {
if (update.eventType === 'USER_DATA_STREAM_EXPIRED') {
if (sockets.user.clean && typeof(sockets.user.clean) === 'function') {
sockets.user.clean()
delete(sockets.user.clean)
}
}
}
const sockets = {
user: {
handler: userMsgHandler,
clean: _ => void, // This isn't used rn
},
}
sockets.user.clean = api.ws.user(sockets.user.handler)