mirror of
https://github.com/Buriburizaem0n/nezha-dash-v1.git
synced 2026-05-06 13:58:43 +00:00
perf: use websocket context
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { createContext } from "react";
|
||||
|
||||
export interface WebSocketContextType {
|
||||
sendMessage: (message: string) => void;
|
||||
lastMessage: MessageEvent | null;
|
||||
readyState: number;
|
||||
}
|
||||
|
||||
export const WebSocketContext = createContext<WebSocketContextType | undefined>(
|
||||
undefined,
|
||||
);
|
||||
Reference in New Issue
Block a user