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

Function maxBy

packages/reactivity/__tests__/reactiveArray.spec.ts:641–645  ·  view source on GitHub ↗
(prev: any, cur: any)

Source from the content-addressed store, hash-verified

639
640 deep = reactive([{ val: 1 }, { val: 2 }])
641 const maxBy = (prev: any, cur: any) => {
642 expect(isReactive(prev)).toBe(true)
643 expect(isReactive(cur)).toBe(true)
644 return prev.val > cur.val ? prev : cur
645 }
646 left = computed(() => deep.reduce(maxBy))
647 right = computed(() => deep.reduceRight(maxBy))
648 expect(left.value).toMatchObject({ val: 2 })

Callers

nothing calls this directly

Calls 1

isReactiveFunction · 0.90

Tested by

no test coverage detected