Add an official utility to clone ref
and reactive
#766
mrleblanc101
started this conversation in
General
Replies: 1 comment
-
Since Vue 3 is modular, this would add any weigth. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've stumbled upon this issue: vuejs/core#8975
The recommandation was to use
toRaw
to clone aref
or areactive
.But since
ref
andreactive
allow to compose reactive objects,toRaw
still may not work for them due to how it works: https://stackoverflow.com/a/72633173/16716350There are multiple cloning library, but shouldn't Vue ship their own utility for this ?
Since we already have multiple other utility to handle
ref
andreactive
like https://vuejs.org/api/reactivity-utilities.htmlIt would be useful to add a
toClone()
ortoCloned()
utility.I've also created an issue in
vuejs/docs
to document this:vuejs/docs#3223
Beta Was this translation helpful? Give feedback.
All reactions