socket.io-react-hooks-advanced
Version:
A modular and extensible React + Socket.IO hook library designed for real-world applications. Supports namespaced sockets, reconnection strategies, offline queues, latency monitoring, middleware, encryption, and more.
8 lines (7 loc) • 413 B
TypeScript
export declare const useSocketClient: () => {
socket: import("socket.io-client").Socket<import("@socket.io/component-emitter").DefaultEventsMap, import("@socket.io/component-emitter").DefaultEventsMap> | null;
connected: boolean;
emitEvent: (event: string, data: any, callback?: (...args: any[]) => void) => void;
reconnect: () => void;
setAuthToken: ((token: string) => void) | undefined;
};