Viktorani API - v0.0.8
    Preparing search index...

    Function useTransport

    • Subscribe to the current transport connection status and expose a stable send callback.

      Returns {
          send: (event: TransportEvent) => void;
          status: TransportStatus;
          type: TransportType;
      }

      Wraps the module-level transportManager singleton so React components don't need to import it directly. Status updates trigger re-renders; send is memoised and never changes identity.

      function BuzzerButton() {
      const { status, send } = useTransport()
      return (
      <button
      disabled={status !== 'connected'}
      onClick={() => send({ type: 'BUZZ', playerId, playerName, timestamp: Date.now() })}
      >
      Buzz!
      </button>
      )
      }