-
Notifications
You must be signed in to change notification settings - Fork 94
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
fix stale props being passed to promiseFn when using watchFn #181
fix stale props being passed to promiseFn when using watchFn #181
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit dffd39f:
|
Codecov Report
@@ Coverage Diff @@
## next #181 +/- ##
==========================================
+ Coverage 98.58% 98.73% +0.14%
==========================================
Files 8 8
Lines 424 395 -29
Branches 148 143 -5
==========================================
- Hits 418 390 -28
+ Misses 6 5 -1 Continue to review full report at Codecov.
|
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.
Another solution is to add lastOptions.current = options
before the load()
on line 135.
Any chance to get this released soon? |
2f2e572
to
dffd39f
Compare
Thanks for reminding me. We were focused on the TypeScript migration, but that's merged now. This is looking good, so it's going out with the next release, which will be sometime this week. |
@all-contributors Please add @salolivares for code |
I've put up a pull request to add @salolivares! 🎉 |
@all-contributors Please add @salolivares for bug |
I've put up a pull request to add @salolivares! 🎉 |
@Jyrno42 I published a pre-release here: v10.0.0-alpha.0 |
Description
When watching for a variable changes using watchFn, the react async hook properly re-runs promiseFn but with old props passed in. This fix aims to correct that behavior.
This fixes #180
Checklist
Make sure you check all the boxes. You can omit items that are not applicable.