-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Description
Describe the problem
DOMRect is a super convenient native API to represent rectangular shapes (not only DOM ones). I encountered a situation where I needed to create a reactive rect, but found out that it is missing from svelte/reactivity. I think it would be a really nice addition to the reactivity package.
Describe the proposed solution
It could look something like this:
import { SvelteDOMRect } from "svelte/reactivity";
const rect = new SvelteDOMRect();
$inspect(rect.left); // init 0; update 100
$inspect(rect.right); // init 0; update 200
setTimeout(() => {
rect.x = 100;
rect.width = 100;
});If somebody from the maintainers approves this feature, I can make a PR.
Importance
would make my life easier
JLAcostaEC
Metadata
Metadata
Assignees
Labels
No labels