I started writing some notebooks about interacting with SVG elements and since I wanted to break them into small, readable cells, I turned to mutable
for storing the outcomes of mouse events. Then, little bits of imperative code attach these event listeners to SVG elements (obtained via querySelector
) and update their attributes based on the mutable values.
Before I continue with this pattern, I wanted to ask if there’s a more idiomatic alternative to using mutable
for such use-cases.
(Similar to what @kelleyvanevert asked here.)