MCPcopy Create free account
hub / github.com/Xu22Web/tech-study-js / createReactiveObj

Function createReactiveObj

tech-study.js:1121–1131  ·  view source on GitHub ↗
(target, isReadonly, shallow)

Source from the content-addressed store, hash-verified

1119 * @description reactive object
1120 */
1121const createReactiveObj = (target, isReadonly, shallow) => {
1122 // 存在 Proxy
1123 const existingProxy = proxyMap.get(target);
1124 if (existingProxy) {
1125 return existingProxy;
1126 }
1127 // 新建
1128 const proxy = new Proxy(target, createReactiveHandlers(isReadonly, shallow));
1129 proxyMap.set(target, proxy);
1130 return proxy;
1131};
1132/**
1133 * @description reactive
1134 * @param val

Callers 4

createReactiveFunction · 0.70
shallowReactiveFunction · 0.70
createReadonlyFunction · 0.70
shallowReadonlyFunction · 0.70

Calls 3

createReactiveHandlersFunction · 0.70
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected