This functions provides simple websocket client capabilities.
# StateThe useWebSocket
function exposes the following reactive state:
Ref<string>
The current websocket state, can be only one of: 'OPEN', 'CONNECTING', 'CLOSING', 'CLOSED' data Ref<object>
Reference to the latest data received via the websocket, can be watched to respond to incoming messages # Methods
useWebSocket
exposes the following methods:
(data: any) => void
Sends data through the websocket connection. close (code?: number, reason?: string) => void
Closes the websocket connection gracefully. # Example # Demo
TODO: Cool Chat app maybe
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4