mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-07-03 03:21:46 +02:00
Add SSE response summary helpers (#466)
Co-authored-by: Gregory Schier <gschier1990@gmail.com>
This commit is contained in:
@@ -6,7 +6,12 @@ import { getResponseBodyEventSource } from "../lib/responseBody";
|
||||
export function useResponseBodyEventSource(response: HttpResponse) {
|
||||
return useQuery<ServerSentEvent[]>({
|
||||
placeholderData: (prev) => prev, // Keep previous data on refetch
|
||||
queryKey: ["response-body-event-source", response.id, response.contentLength],
|
||||
queryKey: [
|
||||
"response-body-event-source",
|
||||
response.id,
|
||||
response.updatedAt,
|
||||
response.contentLength,
|
||||
],
|
||||
queryFn: () => getResponseBodyEventSource(response),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user