Refactor plugin manager and gRPC server (#96)

This commit is contained in:
Gregory Schier
2024-09-19 05:58:12 -07:00
committed by GitHub
parent 844d795014
commit a3b64423fd
27 changed files with 661 additions and 614 deletions

View File

@@ -0,0 +1,13 @@
import { useMutation } from '@tanstack/react-query';
import { trackEvent } from '../lib/analytics';
import { invokeCmd } from '../lib/tauri';
export function useInstallPlugin() {
return useMutation<void, unknown, string>({
mutationKey: ['install_plugin'],
mutationFn: async (directory: string) => {
await invokeCmd('cmd_install_plugin', { directory });
},
onSettled: () => trackEvent('plugin', 'create'),
});
}