Skip to content

Very Basic, Ref doesn't react to property change as expected #9116

Discussion options

You must be logged in to vote

There are several aspects form why this won't work.

Disclaimer: Before I go into them, I'll just say that the recommendation is to not use complex 3rd party objects (like i.e. Tone.Transport) as reactive data. complex classes like this one have to many ways in which they cn change their internal state that bypasses reactivity's change detection. Vue's recommendation is to use plain objects for reactive state only.

With that out of the way, here's why your code does not work - it's fundamentaly a misunderstanding about Javascript foremost:

You are severing the connection between the property Tone.Transport.position and the initial value of it that you pass to ref(). Here's your code, sligh…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mordini
Comment options

Answer selected by mordini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants