mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-15 08:13:27 +01:00
15 lines
446 B
TypeScript
15 lines
446 B
TypeScript
import { useFastMutation } from './useFastMutation';
|
|
import { useSendAnyHttpRequest } from './useSendAnyHttpRequest';
|
|
|
|
export function useSendManyRequests() {
|
|
const sendAnyRequest = useSendAnyHttpRequest();
|
|
return useFastMutation<void, string, string[]>({
|
|
mutationKey: ['send_many_requests'],
|
|
mutationFn: async (requestIds: string[]) => {
|
|
for (const id of requestIds) {
|
|
sendAnyRequest.mutate(id);
|
|
}
|
|
},
|
|
});
|
|
}
|