Skip to content

Visibility Handling

Pause timers, media, and polling when the page is hidden:

ts
lifecycle.on("page:hidden", () => pauseWork());
lifecycle.on("page:visible", () => resumeWork());

Assuming page:hidden always means the user left the application.

Playground

Visibility Playground

Pattern

Visibility Pause

An ecosystem of independent, headless TypeScript libraries engineered for modern web development. Every package includes interactive playgrounds and documentation that evolves alongside the code.