mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-05-13 19:30:39 +02:00
Split codebase (#455)
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