-
Notifications
You must be signed in to change notification settings - Fork 261
Expand file tree
/
Copy pathrpcApiSlice.ts
More file actions
23 lines (18 loc) · 910 Bytes
/
rpcApiSlice.ts
File metadata and controls
23 lines (18 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import {type CreateApi} from '@reduxjs/toolkit/query';
import {coreModuleName} from '@reduxjs/toolkit/query';
import {typeGuard} from '../../../utils';
import {cacheTagTypes} from '../cacheTags/CacheTagTypes';
import {getSerializeQueryArgs} from '../getSerializeQueryArgs';
import {rpcBaseQuery} from './rpcBaseQuery';
import {RpcEndpointBuilder} from './rpcEndpointBuilder';
import {RpcReducerPath} from './rpcReducerPath';
type ModuleName = typeof coreModuleName;
export const createRpcApiSlice = <T extends ModuleName>(createRtkQueryApi: CreateApi<T>) =>
createRtkQueryApi({
reducerPath: typeGuard<RpcReducerPath>('superfluid_rpc'),
baseQuery: rpcBaseQuery(),
tagTypes: cacheTagTypes,
endpoints: (_builder: RpcEndpointBuilder) => ({}),
serializeQueryArgs: getSerializeQueryArgs(),
});
export type RpcApiSliceEmpty = ReturnType<typeof createRpcApiSlice>;