migrated from redux to recoil
This commit is contained in:
11
frontend/src/hooks/useRPC.ts
Normal file
11
frontend/src/hooks/useRPC.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { useRecoilValue } from 'recoil'
|
||||
import { rpcClientState } from '../atoms/rpc'
|
||||
|
||||
export const useRPC = () => {
|
||||
const client = useRecoilValue(rpcClientState)
|
||||
|
||||
return {
|
||||
client,
|
||||
socket$: client.socket$
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user