Files
yaak-mountain-loop/src-web/hooks/useInstallPlugin.ts
2024-12-20 17:38:41 -08:00

14 lines
442 B
TypeScript

import { useFastMutation } from './useFastMutation';
import { trackEvent } from '../lib/analytics';
import { invokeCmd } from '../lib/tauri';
export function useInstallPlugin() {
return useFastMutation<void, unknown, string>({
mutationKey: ['install_plugin'],
mutationFn: async (directory: string) => {
await invokeCmd('cmd_install_plugin', { directory });
},
onSettled: () => trackEvent('plugin', 'create'),
});
}