I use RTK Query. I need to make several requests to one endpoint, because for each request(with unchanged arguments) the server will return another pack with air tickets. Please tell me how can I save the results of all calls to the useGetQuery hook. I need to sort and render all tickets.
const [pollingInterval, setPollingInterval] = useState(1000);
const {data, isError, isLoading} = useGetTicketsQuery(searchID, {
pollingInterval,
})
if (data && data.stop && pollingInterval !==0){
// if server return "stop", search is over
setPollingInterval(0);
}