websocket updates

* sync page title on icon via websocket
* sync on page tree too
This commit is contained in:
Philipinho
2024-04-27 15:40:22 +01:00
parent 390d58793a
commit 8cc7d39146
17 changed files with 253 additions and 15 deletions

View 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);
};
};