Consider the following svelte component
<script>
let x;
$: y = window.innerWidth;
</script>
<svelte.window bind:innerWidth={x} />
<h1>{x}</h1>
<h1>{y}</h1>
<h1>{window.innerWidth}</h1>
This renders three h1 HTML elements, which show the innerWidth attribute of the window object.
However, only the first of them will update as you change the width of the window.
My question is why don't the other approaches update as the window width changes?
I'm new to javascript and svelte, but it looks as though <svelte.window /> is an import, which allows us to bind to the window object, which seems to allow us to "listen" to updates on window.innerWidth. But why not the other approaches? Why aren't they connected?