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()andemit()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, andsetTimeout. 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.
-
tabIdis ephemeral. It’s generated per instance (withcrypto.randomUUID()or a manual fallback) and doesn’t persist across page reloads — don’t use it as a stable user or session identifier.
Next step
Section titled “Next step”- Lifecycle events explains the deferral of
tab:joinand thedestroy()guard in detail. - The Tabus class reference documents the exact signature of every method.
