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

Method get_

packages/mobx/src/types/observablearray.ts:346–357  ·  view source on GitHub ↗
(index: number)

Source from the content-addressed store, hash-verified

344 }
345
346 get_(index: number): any | undefined {
347 if (this.legacyMode_ && index >= this.values_.length) {
348 console.warn(
349 __DEV__
350 ? `[mobx.array] Attempt to read an array index (${index}) that is out of bounds (${this.values_.length}). Please check length first. Out of bound indices will not be tracked by MobX`
351 : `[mobx] Out of bounds read: ${index}`
352 )
353 return undefined
354 }
355 this.atom_.reportObserved()
356 return this.dehanceValue_(this.values_[index])
357 }
358
359 set_(index: number, newValue: any) {
360 const values = this.values_

Callers 4

getFunction · 0.45
getFunction · 0.45
getFunction · 0.45

Calls 2

dehanceValue_Method · 0.95
reportObservedMethod · 0.65

Tested by

no test coverage detected