How yunuseeeeeeee/yunze-kovan works
Yunze Kovan is a small browser library for coordinating same-origin tabs as one app. Application code creates a named hive; tabs discover peers over BroadcastChannel, elect a leader, and synchronize shared state. The leader can run leader-only work and handle requests from other tabs, while events reach all tabs. The runtime behavior is implemented in both the ES module and UMD entry point; the sampled source shows these capabilities within a single implementation, not separate internal modules.
Main entry points: index.mjs Hive API
Components 9
Tab coordination
- Leader election
index.mjs - BroadcastChannel
- Peer tabs
Shared runtime
- Hive API
index.mjs - Shared state
index.mjs - Leader work
index.mjs - Leader RPC
index.mjs - Cross-tab events
index.mjs
Other components
- Application code
Connections 14
- Application code → Hive API: creates hive
README.md - Hive API → BroadcastChannel: opens channel
index.mjs - BroadcastChannel → Hive API: delivers messages
index.mjs - Peer tabs → BroadcastChannel: exchange messages
README.md - Hive API → Leader election: elects leader
index.mjs - Leader election → Leader work: starts or stops
index.mjs - Hive API → Shared state: reads and writes
index.mjs - Shared state → BroadcastChannel: broadcasts updates
index.mjs - BroadcastChannel → Shared state: merges updates
index.mjs - Application code → Leader work: registers work
README.md - Application code → Leader RPC: registers or requests
README.md - BroadcastChannel → Leader RPC: delivers requests
index.mjs - Application code → Cross-tab events: emits or listens
README.md - BroadcastChannel → Cross-tab events: delivers events
index.mjs