-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(reactivity): avoid duplication proxy #3052
fix(reactivity): avoid duplication proxy #3052
Conversation
delete useless code in function reactive(#2951)
|
You have a point here, but I don't think the solution is the best one. Checking the WeakMap for an existing entry is a comparatively expensive OP, which is why it's been placed after the check of Will look further into it later. |
@LinusBorg i push the pr again, modify the solution of avoiding duplication proxy by 'isReadonly' and 'isShallow' property |
694cdc0
to
4b79bac
Compare
in vue3, designing reactiveMap and readonlyMap is for cache the proxy version if the target has the proxy or the target is a proxy, but in you pr, the code below will cause the cache useless
in code above, i want to make proxyCopy === proxy returns true
in order to solve the problem,the createReactiveObject function may modify follow below