Skip to content

Leader Election

Elect one tab to own background work.

Implementation

ts
lifecycle.on("tab:primary", () => becomeLeader());
lifecycle.on("tab:secondary", () => resignLeadership());

Testing

Open multiple tabs and verify promotion when the leader closes.

Playground

Cross Tab Playground

Tutorial

Advanced Tutorial

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