mirror of
https://github.com/ArthurDanjou/trpc-nuxt.git
synced 2026-02-05 14:47:58 +01:00
fix: trpc client composable type
This commit is contained in:
@@ -6,7 +6,7 @@ import type {
|
|||||||
_Transform,
|
_Transform,
|
||||||
} from 'nuxt/dist/app/composables/asyncData'
|
} from 'nuxt/dist/app/composables/asyncData'
|
||||||
import type { ProcedureRecord, inferHandlerInput, inferProcedureInput, inferProcedureOutput } from '@trpc/server'
|
import type { ProcedureRecord, inferHandlerInput, inferProcedureInput, inferProcedureOutput } from '@trpc/server'
|
||||||
import type { TRPCClientErrorLike } from '@trpc/client'
|
import type { TRPCClient, TRPCClientErrorLike } from '@trpc/client'
|
||||||
import { objectHash } from 'ohash'
|
import { objectHash } from 'ohash'
|
||||||
import { useAsyncData, useNuxtApp, useState } from '#app'
|
import { useAsyncData, useNuxtApp, useState } from '#app'
|
||||||
// @ts-expect-error: Resolved by Nuxt
|
// @ts-expect-error: Resolved by Nuxt
|
||||||
@@ -61,5 +61,5 @@ export async function useAsyncQuery<
|
|||||||
|
|
||||||
export function useClient() {
|
export function useClient() {
|
||||||
const { $client } = useNuxtApp()
|
const { $client } = useNuxtApp()
|
||||||
return $client
|
return $client as TRPCClient<AppRouter>
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user