-
Notifications
You must be signed in to change notification settings - Fork 99
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
feat: new hook useSyncedRef
#42
Conversation
Codecov Report
@@ Coverage Diff @@
## master #42 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 19 20 +1
Lines 155 163 +8
Branches 22 22
=========================================
+ Hits 155 163 +8
Continue to review full report at Codecov.
|
What's an example use case for this hook? It doesn't seem like the example story illustrates one very well. |
I'm unable to imagine different =( |
Do you have an example where this hook would be useful in general? I think I need help "getting" this one. |
It is mostly required for other hooks, to provide stable API, 4ex: Will be replaced with this hook. P.s.: just realized that i wanted to write it in docs =) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thanks for pointing that out! Let's roll with it
# [1.18.0](v1.17.0...v1.18.0) (2021-05-06) ### Features * new hook `useSyncedRef` ([#42](#42)) ([49810a0](49810a0))
🎉 This PR is included in version 1.18.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What new hook does?
Like
useRef
, but it returns immutable ref that contains actual value.I'm not sure about hook naming, i dont really like the
useSyncedRef
, but it is the best i came up with.Checklist