mirror of
https://github.com/Shadowfita/docmost.git
synced 2025-11-13 16:22:32 +10:00
websocket updates
* sync page title on icon via websocket * sync on page tree too
This commit is contained in:
11
apps/client/src/features/websocket/use-query-emit.ts
Normal file
11
apps/client/src/features/websocket/use-query-emit.ts
Normal file
@ -0,0 +1,11 @@
|
||||
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);
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user