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

Function createMap

packages/reactivity/__benchmarks__/reactiveMap.bench.ts:5–13  ·  view source on GitHub ↗
(obj: Record<string, any>)

Source from the content-addressed store, hash-verified

3import { computed, reactive } from '../dist/reactivity.esm-browser.prod'
4
5function createMap(obj: Record<string, any>) {
6 const map = new Map()
7 for (const key in obj) {
8 if (obj.hasOwnProperty(key)) {
9 map.set(key, obj[key])
10 }
11 }
12 return map
13}
14
15bench('create reactive map', () => {
16 reactive(createMap({ a: 1 }))

Callers 1

Calls 1

setMethod · 0.45

Tested by

no test coverage detected