migrated from redux to recoil
This commit is contained in:
12
frontend/src/atoms/rpc.ts
Normal file
12
frontend/src/atoms/rpc.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { selector } from 'recoil'
|
||||
import { RPCClient } from '../lib/rpcClient'
|
||||
import { rpcHTTPEndpoint, rpcWebSocketEndpoint } from './settings'
|
||||
|
||||
export const rpcClientState = selector({
|
||||
key: 'rpcClientState',
|
||||
get: ({ get }) =>
|
||||
new RPCClient(get(rpcHTTPEndpoint), get(rpcWebSocketEndpoint)),
|
||||
set: ({ get }) =>
|
||||
new RPCClient(get(rpcHTTPEndpoint), get(rpcWebSocketEndpoint)),
|
||||
dangerouslyAllowMutability: true,
|
||||
})
|
||||
Reference in New Issue
Block a user