Mutation cancellations?
#2914
-
are the cancellations features https://react-query.tanstack.com/guides/query-cancellation available for useMutation hook as well? actually I can do it myself, here's my usecase const abortController = new AbortController();
const mutation = useMutation(async (data, { signal }) => {
for (const stuff of stuffs) {
if (signal.aborted) break;
await api.post(url, stuff);
}
})
// other button would call abortController.abort() |
Beta Was this translation helpful? Give feedback.
Answered by
caub
Nov 11, 2021
Replies: 1 comment
-
also already discussed here #1551 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
caub
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
also already discussed here #1551