MCPcopy Create free account
hub / github.com/codealong-dev/ride-sharing / sendMessage

Function sendMessage

web/src/hooks/useDriverStreamConnection.ts:91–97  ·  view source on GitHub ↗
(message: ClientWsMessage)

Source from the content-addressed store, hash-verified

89 }, [userID]);
90
91 const sendMessage = (message: ClientWsMessage) => {
92 if (ws?.readyState === WebSocket.OPEN) {
93 ws.send(JSON.stringify(message));
94 } else {
95 setError('WebSocket is not connected');
96 }
97 };
98
99 const resetTripStatus = () => {
100 setTripStatus(null);

Callers 2

handleAcceptTripFunction · 0.85
handleDeclineTripFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected