Skip to content
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

Reactivity: Support for shallow collections #1202

Closed
doman412 opened this issue May 18, 2020 · 0 comments · Fixed by #1204
Closed

Reactivity: Support for shallow collections #1202

doman412 opened this issue May 18, 2020 · 0 comments · Fixed by #1204

Comments

@doman412
Copy link

Version

3.0.0-beta.13

Reproduction link

https://jsfiddle.net/exp6b1Lj/2/

Steps to reproduce

  • create a shallow Set shallowReactive(new Set())
  • add an object to the set
  • iterate over the set or convert to an array
  • objects in the loop or new array will be reactive

What is expected?

Collections should respect the shallow-ness and not covert objects added to the collection to reactive objects.

What is actually happening?

Objects added to collections are being converted to reactive objects despite the collection being created with shallowReactive


I am using the @vue/reactivity package in another project and came across this issue. Looking through the source it seems like this is not even a feature of collections at the moment as the object is always wrapped by either toReadonly or toReactive. My use case is I want to mainly track the changes to the collection itself, adding, setting, deleting without converting the objects within.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant