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

Function isMemoSame

packages/runtime-core/src/helpers/withMemo.ts:23–40  ·  view source on GitHub ↗
(cached: VNode, memo: any[])

Source from the content-addressed store, hash-verified

21}
22
23export function isMemoSame(cached: VNode, memo: any[]): boolean {
24 const prev: any[] = cached.memo!
25 if (prev.length != memo.length) {
26 return false
27 }
28
29 for (let i = 0; i < prev.length; i++) {
30 if (hasChanged(prev[i], memo[i])) {
31 return false
32 }
33 }
34
35 // make sure to let parent block track it when returning cached
36 if (isBlockTreeEnabled > 0 && currentBlock) {
37 currentBlock.push(cached)
38 }
39 return true
40}

Callers 1

withMemoFunction · 0.85

Calls 2

hasChangedFunction · 0.90
pushMethod · 0.65

Tested by

no test coverage detected