query
query copied to clipboard
perf(query-core): clear query's revertState once fetching ends successfully
The #revertState attribute of the Query class is used as a fallback for fetching failure.
Clearing it once fetching ends successfully improve memory usage, particularly with queries returning large amount of data.
More context in this discussion: https://github.com/TanStack/query/discussions/9264
NB: I didn't add unit tests for this modification. Indeed, as #revertState is a hash private attribute, I see no way to access it in unit tests to check if it is properly reset.