Replies: 2 comments
-
That final example can be implemented using a const myVar = ref(initialValue)
const myVarWrapper = computed({
get() {
return myVar.value
},
set(val) {
console.trace('myVar was changed to', val)
myVar.value = val
}
}) Docs: https://vuejs.org/guide/essentials/computed.html#writable-computed Using a |
Beta Was this translation helpful? Give feedback.
0 replies
-
Do you need the following functionality? watch(
() => isActiveChartPaneAction.value,
newIsActiveChartPaneAction => {
console.log('IS_ACTIVE_PANE_CHART_ACTION', newIsActiveChartPaneAction)
},
{
onTrack(e) {
console.log(e) // DebuggerEvent
},
onTrigger(e) {
console.log(e) // DebuggerEvent
},
},
) According to the official documentation: This is also supported in |
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
Uh oh!
There was an error while loading. Please reload this page.
-
I think it's a good idea to have something that helps debug what triggers the
watch
.In my case, I have a
ref
that changes very frequently, and it's hard to track what exactly caused the change.I could wrap every assignment to the value, but that would require changing the whole codebase where the value is being set, which is not ideal.
Maybe using a proxy-like wrapper could help, something like this:
It's a simple idea, but it could improve the developer experience when debugging reactive variables.
Beta Was this translation helpful? Give feedback.
All reactions