Skip to content

Commit bfaa172

Browse files
author
Jon Eyrick
authored
clear depth cache by evan-coygo
2 parents 6e65960 + f14a326 commit bfaa172

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

node-binance-api.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1841,6 +1841,17 @@ let api = function Binance() {
18411841
return subscription.endpoint;
18421842
},
18431843

1844+
/**
1845+
* Clear websocket depthcache
1846+
* @param {String|Array} symbols - a single symbol, or an array of symbols, to clear the cache of
1847+
*/
1848+
clearDepthCache(symbols) {
1849+
const symbolsArr = Array.isArray(symbols) ? symbols : [symbols];
1850+
symbolsArr.forEach((thisSymbol) => {
1851+
delete Binance.depthCache[thisSymbol];
1852+
});
1853+
},
1854+
18441855
/**
18451856
* Websocket staggered depth cache
18461857
* @param {array/string} symbols - an array of symbols to query

0 commit comments

Comments
 (0)