Skip to content

Visibility Pause

Pause expensive work when the document is hidden.

Implementation

ts
lifecycle.on("page:hidden", () => worker.pause());
lifecycle.on("page:visible", () => worker.resume());

Performance

Reduces CPU, network, and battery use for background tabs.

Playground

Visibility Playground

JOC is a JayOnCode monorepo of @jayoncode/* packages. Docs sync from source via TypeDoc and sync scripts.