feat: add reactive inputs

This commit is contained in:
wobsoriano
2023-05-26 20:41:22 -07:00
parent e15a62a5b2
commit 054fad952a
3 changed files with 36 additions and 4 deletions

View File

@@ -19,6 +19,7 @@ import type {
KeysOf,
PickFrom,
} from 'nuxt/dist/app/composables/asyncData'
import type { Ref } from 'vue'
interface TRPCRequestOptions extends _TRPCRequestOptions {
abortOnUnmount?: boolean
@@ -44,6 +45,8 @@ type SubscriptionResolver<
]
) => Unsubscribable
type MaybeRef<T> = T | Ref<T>
type DecorateProcedure<
TProcedure extends AnyProcedure,
TRouter extends AnyRouter,
@@ -55,7 +58,7 @@ type DecorateProcedure<
DataT = ResT,
PickKeys extends KeysOf<DataT> = KeysOf<DataT>,
>(
input: inferProcedureInput<TProcedure>,
input: MaybeRef<inferProcedureInput<TProcedure>>,
opts?: AsyncDataOptions<ResT, DataT, PickKeys> & { trpc?: TRPCRequestOptions },
) => AsyncData<PickFrom<DataT, PickKeys>, DataE>,
query: Resolver<TProcedure>