Skip to content

Considerations and limits

Before integrating tabus-js into your app, keep these by-design behaviors in mind:

const bus = new Tabus<{ data: number }>("app");
const handleData = (value: number) => console.log(value);
bus.on("data", handleData);
function send(value: number) {
bus.emit("data", value);
handleData(value); // explicit local processing
}
  • After destroy(), on() and emit() are safe no-ops. They don’t throw and have no effect — they simply do nothing. There’s no need to manually check whether an instance is still alive before using it.

  • Zero runtime dependencies. tabus-js only uses native APIs from the environment: BroadcastChannel, crypto.randomUUID, and setTimeout. There’s nothing to keep up to date from transitive dependencies.

  • Delivery order isn’t guaranteed across tabs under different load. If two tabs emit at nearly the same time, the order each peer receives them in depends on the browser’s scheduler, not on a global clock.

  • tabId is ephemeral. It’s generated per instance (with crypto.randomUUID() or a manual fallback) and doesn’t persist across page reloads — don’t use it as a stable user or session identifier.