mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-15 21:53:36 +01:00
14 lines
442 B
TypeScript
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'),
|
|
});
|
|
}
|