A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://Tarektouati.github.io/vue-use-web/functions/websocket.html below:

Website Navigation


Web Sockets | useWeb

# Web Sockets

This functions provides simple websocket client capabilities.

# State

The useWebSocket function exposes the following reactive state:

State Type Description 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:

Method Signature Description send (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