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