animl-frontend
animl-frontend copied to clipboard
Implement request cancellation
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
Related: #213 and #208