import { Target } from '../shared/svu' ; import { isObject } from '../shared' ; import { mutableHandlers , } from './baseHandlers' ; export const reactiveMap = new WeakMap < Target , any > ( ) ; const reactive = ( target ) => { return createReactiveobject ( target , mutableHandlers ) ; } ; function createReactiveobject ( target , baseHandlers ) { if ( ! isObject ( target ) ) { return target ; } const proxyMap = reactiveMap ; const existingProxy = proxyMap . get ( target ) ; if ( existingProxy ) { return existingProxy ; } const proxy = new Proxy ( target , baseHandlers ) ; proxyMap . set ( target , proxy ) ; return proxy ; } export { reactive } ; export function isReactive ( value ) { return ! ! ( value && value . __v_isReactive ) ; } export function toRaw ( observed ) { return true ; } export function markRaw ( observed ) { return true ; }