0.0.1 • Published 11 months ago
@sito/socket-client v0.0.1
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),
});
0.0.1
11 months ago