mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-23 20:45:59 +00:00
client metadata caching
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import io from 'socket.io-client';
|
||||
import React from 'react';
|
||||
import resolveApi from './resolveApi';
|
||||
import { cacheClean } from './cache';
|
||||
|
||||
const SocketContext = React.createContext(null);
|
||||
|
||||
@@ -10,6 +11,7 @@ export function SocketProvider({ children }) {
|
||||
// const newSocket = io('http://localhost:3000', { transports: ['websocket'] });
|
||||
const newSocket = io(resolveApi());
|
||||
setSocket(newSocket);
|
||||
newSocket.on('clean-cache', (reloadTrigger) => cacheClean(reloadTrigger));
|
||||
}, []);
|
||||
return <SocketContext.Provider value={socket}>{children}</SocketContext.Provider>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user