mirror of
https://github.com/Buriburizaem0n/nezha-dash-v1.git
synced 2026-02-05 05:00:07 +00:00
perf: use websocket context
This commit is contained in:
11
src/context/websocket-context.ts
Normal file
11
src/context/websocket-context.ts
Normal file
@@ -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