feat: refactor refresh

This commit is contained in:
hamster1963
2024-12-26 11:07:52 +08:00
parent 704818d084
commit 5334fd2acb
10 changed files with 93 additions and 28 deletions
+4
View File
@@ -5,6 +5,8 @@ export interface WebSocketContextType {
connected: boolean
messageHistory: { data: string }[]
reconnect: () => void
needReconnect: boolean
setNeedReconnect: (needReconnect: boolean) => void
}
export const WebSocketContext = createContext<WebSocketContextType>({
@@ -12,4 +14,6 @@ export const WebSocketContext = createContext<WebSocketContextType>({
connected: false,
messageHistory: [],
reconnect: () => {},
needReconnect: false,
setNeedReconnect: () => {},
})