-
-
Notifications
You must be signed in to change notification settings - Fork 443
feat(FieldApi): allow debounce of onChange and onBlur listener #1375
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(FieldApi): allow debounce of onChange and onBlur listener #1375
Conversation
View your CI Pipeline Execution ↗ for commit aeb1e38.
☁️ Nx Cloud last updated this comment at |
The naming between the debounce properties seems inconsistent. |
1b0a30c
to
2d76c2f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1375 +/- ##
==========================================
+ Coverage 88.88% 89.04% +0.16%
==========================================
Files 28 28
Lines 1277 1296 +19
Branches 335 340 +5
==========================================
+ Hits 1135 1154 +19
Misses 126 126
Partials 16 16 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
I see you're using the existing timeoutIds
but isn't that dangerous?
I mean, wouldn't it break if you have both a debounce on the validator and on the listener since they're sharing the same timeoutId?
Good catch - I've separated the validation and listener timeoutIds |
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.
LGTM, also thanks for adding the docs!
This allows you to listen to a
change
/blur
event of a Field after a denounce you can set in millisecond.It makes situations possible where you want to introduce a side effect after the user stopped typing or left the field for some time.