MCPcopy Index your code
hub / github.com/mobxjs/mobx / reserveArrayBuffer

Function reserveArrayBuffer

packages/mobx/src/types/legacyobservablearray.ts:138–145  ·  view source on GitHub ↗
(max: number)

Source from the content-addressed store, hash-verified

136}
137
138export function reserveArrayBuffer(max: number) {
139 if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {
140 for (let index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {
141 createArrayBufferItem(index)
142 }
143 OBSERVABLE_ARRAY_BUFFER_SIZE = max
144 }
145}
146
147reserveArrayBuffer(1000)
148

Callers 2

updateArrayLength_Method · 0.70

Calls 1

createArrayBufferItemFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…