MCPcopy Create free account
hub / github.com/ccxt/ccxt / append

Method append

ts/src/base/ws/Cache.ts:87–105  ·  view source on GitHub ↗
(item)

Source from the content-addressed store, hash-verified

85 }
86
87 append (item) {
88 // maxSize may be 0 when initialized by a .filter() copy-construction
89 if (this.maxSize && (this.length === this.maxSize)) {
90 this.shift ()
91 }
92 this.push (item)
93 if (this.clearAllUpdates) {
94 this.clearAllUpdates = false
95 this.clearUpdatesBySymbol = {}
96 this.allNewUpdates = 0
97 this.newUpdatesBySymbol = {}
98 }
99 if (this.clearUpdatesBySymbol[item.symbol]) {
100 this.clearUpdatesBySymbol[item.symbol] = false
101 this.newUpdatesBySymbol[item.symbol] = 0
102 }
103 this.newUpdatesBySymbol[item.symbol] = (this.newUpdatesBySymbol[item.symbol] || 0) + 1
104 this.allNewUpdates = (this.allNewUpdates || 0) + 1
105 }
106}
107
108class ArrayCacheByTimestamp extends BaseCache {

Callers 15

testSafeMethodsFunction · 0.95
testWsCacheFunction · 0.95
__wbg_get_importsFunction · 0.45
constructorMethod · 0.45
handleTradesMethod · 0.45
handleOHLCVMethod · 0.45
handleOrderHelperMethod · 0.45
handleTradesMethod · 0.45
handleTradesMethod · 0.45
handleOHLCVMethod · 0.45
handleOrdersMethod · 0.45
loadPositionsSnapshotMethod · 0.45

Calls 1

pushMethod · 0.80

Tested by 1

mainFunction · 0.36