-
Notifications
You must be signed in to change notification settings - Fork 261
Expand file tree
/
Copy pathrpcApiSlice.ts
More file actions
21 lines (17 loc) · 870 Bytes
/
rpcApiSlice.ts
File metadata and controls
21 lines (17 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import {type CreateApi} from '@reduxjs/toolkit/query';
import {typeGuard} from '../../../utils';
import {type ModuleName} from '../ModuleName';
import {cacheTagTypes} from '../cacheTags/CacheTagTypes';
import {getSerializeQueryArgs} from '../getSerializeQueryArgs';
import {rpcBaseQuery} from './rpcBaseQuery';
import {type RpcEndpointBuilder} from './rpcEndpointBuilder';
import {type RpcReducerPath} from './rpcReducerPath';
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>;