mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-31 06:23:08 +02:00
Refactor desktop app into separate client and proxy apps
This commit is contained in:
15
apps/yaak-client/hooks/useTemplateTokensToString.ts
Normal file
15
apps/yaak-client/hooks/useTemplateTokensToString.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import type { Tokens } from '@yaakapp-internal/templates';
|
||||
import { invokeCmd } from '../lib/tauri';
|
||||
|
||||
export function useTemplateTokensToString(tokens: Tokens) {
|
||||
return useQuery<string>({
|
||||
refetchOnWindowFocus: false,
|
||||
queryKey: ['template_tokens_to_string', tokens],
|
||||
queryFn: () => templateTokensToString(tokens),
|
||||
});
|
||||
}
|
||||
|
||||
export async function templateTokensToString(tokens: Tokens): Promise<string> {
|
||||
return invokeCmd('cmd_template_tokens_to_string', { tokens });
|
||||
}
|
||||
Reference in New Issue
Block a user