mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-06 05:19:05 -05:00
12 lines
409 B
TypeScript
12 lines
409 B
TypeScript
import { useMutation } from '@tanstack/react-query';
|
|
import { event } from '@tauri-apps/api';
|
|
import { trackEvent } from '../lib/analytics';
|
|
|
|
export function useCancelHttpResponse(id: string | null) {
|
|
return useMutation<void>({
|
|
mutationKey: ['cancel_http_response', id],
|
|
mutationFn: () => event.emit(`cancel_http_response_${id}`),
|
|
onSettled: () => trackEvent('http_response', 'cancel'),
|
|
});
|
|
}
|