Any way to force reactivity like in Svelte 4? #13772
Answered
by
brunnerh
raythurnvoid
asked this question in
Q&A
-
I have something like this
Is there any way to force Svelte to trigger reactivity in the places where domMatrix is being used? (i don't care about nested reactivity or checking equality of the old/new values). Imagine this code in Svelte 4
I tried to use
|
Beta Was this translation helpful? Give feedback.
Answered by
brunnerh
Oct 22, 2024
Replies: 1 comment 1 reply
-
You should be able to wrap it in an object to cause updates. let matrix = $state.raw({ value: new DOMMatrix(...) });
// ...
function multiplyMatrices() {
matrix.value.multiplySelf(/* ... */);
matrix = { ...matrix };
} Related issue: |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
raythurnvoid
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should be able to wrap it in an object to cause updates.
Related issue: