Receive a constant stream of updates on websocket connection

This commit is contained in:
Nishad 2020-09-02 08:10:31 +08:00
parent efb9a0b6c5
commit 8be750aa97
1 changed files with 1 additions and 4 deletions

View File

@ -40,10 +40,7 @@ export function ConnectionProvider({ children }) {
}, [connection]);
useEffect(() => {
const id = setInterval(
() => connection._rpcWebSocket.call('ping').catch(() => {}),
2000,
);
const id = connection.onSlotChange(() => null);
return () => clearInterval(id);
}, [connection]);