# browser-window

Tracks the browser window's inner size, updating on every `resize`. Exposed as a single global atom.

## Install

```bash
bun add @valdres/browser-window
```

## Live example

▶ Live example: [https://valdres.dev/svelte/plugins/browser-window](https://valdres.dev/svelte/plugins/browser-window)

## Usage

```ts
import { watch } from "valdres-svelte"
import { windowSizeAtom } from "@valdres/browser-window"

const size = watch(windowSizeAtom) // size.value.width / size.value.height
```

## Exports

| Export           | Kind             | Type                                                   |
| ---------------- | ---------------- | ------------------------------------------------------ |
| `windowSizeAtom` | atom (read-only) | `{ innerWidth, innerHeight, outerWidth, outerHeight }` |

## Cross-framework

A global atom — works in every framework, with the resize listener attached only while something is subscribed.
