Open ashwanisinghh opened 5 months ago
Plus one to this. Preferably also in the core library. We don't use the hook, but use the cube api client load
function via react-query
. Ideally we would be able to pass AbortSignal
to the load function and have it respect it.
The query cancellation documentation react-query
lays it out fairly well. I wouldn't consider it crazy specific specific to react-query
, but helpful for things like cancelling fetch
requests.
I actually see some internal stuff referencing mutex
that might be possible to use for this purpose, but there's no documentation for it as far as I can tell.
If you are interested in working on this issue, please go ahead and provide PR for that. We'd be happy to review it and merge it. If this is the first time you are contributing a Pull Request to Cube, please check our contribution guidelines. You can also post any questions while contributing in the #contributors channel in the Cube Slack.
When we are using the useCubeQuery hook to get the data from cube server & user has routed to some other routes, while the result is being fetched. Then it should cancel out the request , as component from which the request was raised has already unmounted
To Reproduce Steps to reproduce the behavior:
Expected behavior Requests for reports data should have be cancelled out