Skip to content

Conversation

@vankhoawin
Copy link
Contributor

@vankhoawin vankhoawin commented Feb 7, 2020

This PR adds a reset method to the useMutation's MutationResult. This function would be useful in cases where a React function's state should be reset to how it was originally, at initialization. As far as I know, there is only one way to update the data within a useMutation call: https://github.com/tannerlinsley/react-query/blob/07b0a66f39a9ce3b5b61ec720f3aebae6128bce2/src/index.js#L639

This PR also adds a test and some setup for more testing using react-testing-library.

And great work on the project, really been liking the API so far!

PS I'll add TS typing if this PR is approved.

@size-plugin
Copy link
Contributor

size-plugin bot commented Feb 7, 2020

Size report for the changes in this PR:

sizes-cjs Overall size: 6.89 kB (+17 B)

 index.js ⏤  6.89 kB (+17 B)

sizes-es Overall size: 6.75 kB (+16 B)

 index.es.js ⏤  6.75 kB (+16 B)

commit: cbfc871

like it?

⭐️ me 😊

@tannerlinsley
Copy link
Member

I dig it. Thankyou!

@nx-cloud
Copy link

nx-cloud bot commented Mar 5, 2024

View your CI Pipeline Execution ↗ for commit cbfc871.

Command Status Duration Result
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1m 45s View ↗
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-04-08 14:03:39 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants