Fix performance related to having 100s of requests (#123)

This commit is contained in:
Gregory Schier
2024-10-08 15:16:57 -06:00
committed by GitHub
parent 4b7712df80
commit c7eccddac9
34 changed files with 456 additions and 423 deletions

View File

@@ -0,0 +1,14 @@
import { useMutation } from '@tanstack/react-query';
import { useSendAnyHttpRequest } from './useSendAnyHttpRequest';
export function useSendManyRequests() {
const sendAnyRequest = useSendAnyHttpRequest();
return useMutation<void, string, string[]>({
mutationKey: ['send_many_requests'],
mutationFn: async (requestIds: string[]) => {
for (const id of requestIds) {
sendAnyRequest.mutate(id);
}
},
});
}