Skip to content

feat(reset): add onReset and resetKeys props #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 1, 2020

Conversation

kentcdodds
Copy link
Collaborator

What: add onReset and resetKeys props

Why: This makes error recovery much easier (and more declarative)

How: make onReset be called before resetting the internal state and compare resetKeys between renders

Checklist:

  • Documentation
  • Tests
  • Ready to be merged

This allows you to declaritively specify what you want to have happen
when a state reset occurs and also specify when a reset should take
place if a given prop changes.
@codecov-io
Copy link

Codecov Report

Merging #50 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #50   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           21        29    +8     
  Branches         5         7    +2     
=========================================
+ Hits            21        29    +8     
Impacted Files Coverage Δ
src/index.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8c733a0...1f21a40. Read the comment docs.

@kentcdodds kentcdodds merged commit 4e240df into master May 1, 2020
@kentcdodds kentcdodds deleted the pr/add-auto-reset-ability branch May 1, 2020 01:05
@kentcdodds
Copy link
Collaborator Author

🎉 This PR is included in version 2.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants