mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-15 13:43:39 +01:00
14 lines
435 B
TypeScript
14 lines
435 B
TypeScript
import { useMutation } from '@tanstack/react-query';
|
|
import { trackEvent } from '../lib/analytics';
|
|
import { invokeCmd } from '../lib/tauri';
|
|
|
|
export function useCreatePlugin() {
|
|
return useMutation<void, unknown, string>({
|
|
mutationKey: ['create_plugin'],
|
|
mutationFn: async (directory: string) => {
|
|
await invokeCmd('cmd_create_plugin', { directory });
|
|
},
|
|
onSettled: () => trackEvent('plugin', 'create'),
|
|
});
|
|
}
|