Replies: 3 comments 4 replies
-
If I understand correctly vue-use has what you need: |
Beta Was this translation helpful? Give feedback.
4 replies
-
I am not sure what you means. If you do not want to trigger the reativity, just use the value of it. import { ref, reative, watchEffect } from 'vue'
const one = ref(1)
const oneValue = one.value
watchEffect(() => {
console.log(oneValue)
})
const two = reactive({ two: 2 })
const twoValue = two.two
watchEffect(() => {
console.log(twoValue)
}) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you for your answers. ComputedWithControl is a way to achieve exactly the desired effect. I have to explicitely list the dependencies, but that may be a good idea anyway. |
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
-
Hi,
Coming from knockout.js I sometimes miss the function to use a ref/computed value inside another computed function without implicitly creating a dependency on that value.
Knockout provides a peek function, which does exactly that.
The use case is rather low level additions and libraries, but it exists (see the source of e.g vueuse/asyncComputed, they work around it by using promises).
Is there such feature, which is not documented or is it planned?
Beta Was this translation helpful? Give feedback.
All reactions