refactor: 简化客户端创建逻辑并明确泛型类型

- 更新客户端创建逻辑,明确指定泛型类型并简化导出方式。
This commit is contained in:
2026-01-18 03:22:23 +08:00
parent f0ae8196cd
commit debb47a60e

View File

@@ -14,13 +14,13 @@ const getORPCClient = createIsomorphicFn()
}),
}),
)
.client((): RouterClient<typeof router> => {
.client(() => {
const link = new RPCLink({
url: `${window.location.origin}/api/rpc`,
})
return createORPCClient(link)
return createORPCClient<RouterClient<typeof router>>(link)
})
const client: RouterClient<typeof router> = getORPCClient()
const client = getORPCClient()
export const orpc = createTanstackQueryUtils(client)