# 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/vue/plugins/browser-window](https://valdres.dev/vue/plugins/browser-window)

## Usage

```ts
import { useValue } from "valdres-vue"
import { windowSizeAtom } from "@valdres/browser-window"

const size = useValue(windowSizeAtom) // Ref<{ width, 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.
