3 ms·
I find myself using `const state = reactive({...})` exclusively now. It's just way simpler (read:less mental overhead). But, I've only been using the compositio
by mthoms 6y ago
I find myself using `const state = reactive({...})` exclusively now. It's just way simpler (read:less mental overhead). But, I've only been using the composition API for a short while now.
Do experienced Vue devs actually use both regularly?
- gavinray 6y agoPersonally, I rarely use refs. I think they have more use when creating general-purpose libraries for Vue. You can also just call "toRefs()" on a "reactive()" object though. Refs are also useful if you want to destructure a reactive object without breaking the reactivity, scroll down just below this: https://composition-api.vuejs.org/api.html#torefs https://composition-api.vuejs.org/api.html#torefs
- Exuma 6y agoAccording to the vue discord where I asked a lot of composition API questions, pretty much people use ref exclusively. It's much more explicit in your `use*` composition files when you have to call .value. It's rare to me to export a very large object of keys, and I have yet to use it yet.