mirror of
https://github.com/Shadowfita/docmost.git
synced 2025-11-13 08:12:32 +10:00
12 lines
326 B
TypeScript
12 lines
326 B
TypeScript
import { socketAtom } from "@/features/websocket/atoms/socket-atom.ts";
|
|
import { useAtom } from "jotai";
|
|
import { WebSocketEvent } from "@/features/websocket/types";
|
|
|
|
export const useQueryEmit = () => {
|
|
const [socket] = useAtom(socketAtom);
|
|
|
|
return (input: WebSocketEvent) => {
|
|
socket?.emit("message", input);
|
|
};
|
|
};
|