From 209c28513dd0cc17802e9d923bd0935aaa79f87d Mon Sep 17 00:00:00 2001 From: wobsoriano Date: Tue, 27 Dec 2022 17:12:31 -0800 Subject: [PATCH] add getQueryKey doc --- src/client/index.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/client/index.ts b/src/client/index.ts index 96fbbdd..b2f0b84 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -7,7 +7,17 @@ import { type DecoratedProcedureRecord } from './types' import { getCurrentInstance, onScopeDispose, useAsyncData } from '#imports' /** - * Calculates the key used for `useAsyncData` call + * Calculates the key used for `useAsyncData` call. + * + * @example + * + * ```ts + * import { getQueryKey } from 'trpc-nuxt/client' + * + * $client.todo.getTodo(1) + * + * const queryKey = getQueryKey('todo.getTodo', 1) + * ``` */ export function getQueryKey ( path: string,