browser-window

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

Install

bun add @valdres/browser-window

Live example

Loading demo…

Usage

import { injectValue } from "valdres-angular"
import { windowSizeAtom } from "@valdres/browser-window"

size = injectValue(windowSizeAtom) // ValueState<WindowSize> — read size.value()

Exports

ExportKindType
windowSizeAtomatom (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.