MCPcopy
hub / github.com/vuejs/core / reactiveReadArray

Function reactiveReadArray

packages/reactivity/src/arrayInstrumentations.ts:20–25  ·  view source on GitHub ↗
(array: T[])

Source from the content-addressed store, hash-verified

18 * - if input is non-reactive or shallowReactive: the original raw array
19 */
20export function reactiveReadArray<T>(array: T[]): T[] {
21 const raw = toRaw(array)
22 if (raw === array) return raw
23 track(raw, TrackOpTypes.ITERATE, ARRAY_ITERATE_KEY)
24 return isShallow(array) ? raw : raw.map(toReactive)
25}
26
27/**
28 * Track array iteration and return raw array

Callers 5

concatFunction · 0.85
joinFunction · 0.85
toReversedFunction · 0.85
toSortedFunction · 0.85
toSplicedFunction · 0.85

Calls 4

toRawFunction · 0.90
trackFunction · 0.90
isShallowFunction · 0.90
mapMethod · 0.80

Tested by

no test coverage detected