cross-tab-sync

command
v4.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 9 Imported by: 0

README

Cross-Tab Sync

Mirrors state across browser tabs in real time over BroadcastChannel — theme, auth status, a cache revision, and a shared draft all stay in sync between every open tab of the app.

What it shows

  • Publishing and subscribing to named channels via the interop BroadcastChannel binding.
  • Typed signals (JSON-encoded structs) per channel, so each concern syncs independently.
  • The same-origin, no-server sync substrate that the durable kvstate layer uses for its cross-tab watch.

Run

gwc dev examples/public/cross-tab-sync

Open the page in two tabs and change the theme or draft in one — the other updates immediately.

Documentation

Rendered for js/wasm
The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL