animl-frontend icon indicating copy to clipboard operation
animl-frontend copied to clipboard

Implement request cancellation

Open nathanielrindlaub opened this issue 1 year ago • 1 comments

graphql-request supports using AbortController to abort queries that are in-flight: https://github.com/jasonkuhrt/graphql-request/blob/HEAD/examples/request-cancellation.ts

This seems important, especially because users can toggle on/off filters quickly and each one triggers a new GetImages request (and now a separate and slower GetImagesCount request).

Figuring out how to store each controller instance in state might be challenging, though. It would be worth looking into whether Apollo-client or RTK Query supports aborting in-flight requests through their APIs.

Related: #196 and #283

nathanielrindlaub avatar Mar 13 '24 17:03 nathanielrindlaub

Related: #213 and #208

nathanielrindlaub avatar Nov 22 '24 22:11 nathanielrindlaub