We used to set up our own axios CancelToken to cancel value requests but it's deprecated in favour of the web platform's AbortController.
Moreover, in newer versions, react-suspense-fetch creates its own AbortController for each request and passes it on to the store's fetch function. This allows aborting requests (and then evicting them) through the stores instead of having to keep track of ongoing and cancelled requests ourselves in DataProviderApi.
The challenge was that react-suspense-fetch was not providing a way to tell which requests have been aborted in order to evict them from the cache when after the error boundary appears. So I had to tweak things a bit.
We used to set up our own axios
CancelToken
to cancel value requests but it's deprecated in favour of the web platform's AbortController.Moreover, in newer versions, react-suspense-fetch creates its own
AbortController
for each request and passes it on to the store's fetch function. This allows aborting requests (and then evicting them) through the stores instead of having to keep track of ongoing and cancelled requests ourselves inDataProviderApi
.The challenge was that react-suspense-fetch was not providing a way to tell which requests have been aborted in order to evict them from the cache when after the error boundary appears. So I had to tweak things a bit.