@sito/socket-client
v0.0.1
Published
Super small lib for socket client
Downloads
4
Readme
Super small Socket Client for chat
Events
- connected - to know if the client connected
- disconnect - to know if the client disconnected
- notify - to know if the client has to sync with the server
- error - to know if an error has occurred
How to use
import { SocketClient } from "@sito/socket-client";
const serverUrl = process.env.SERVER_URL;
const socket = new SocketClient(serverUrl, {
onConnected: (socket) => console.info(socket),
onDisconnect: (socket) => console.info(socket),
onNotify: (socket) => console.info(socket),
});