-
Notifications
You must be signed in to change notification settings - Fork 406
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(form-plugin): introduce conditional debounce #1061
fix(form-plugin): introduce conditional debounce #1061
Conversation
make the form-plugin dispath actions immediately when the form's updateOn is 'blur' or 'submit' or when the ngxsFormDebounce is less than zero
Please add tests to your new functionality. |
add missing tests
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.
Great work! Thanks for the contribution.
@FortinFred Do you think there could be any scenario where an application would rely on the broken behavior?
cc @splincode @arturovt
@markwhitfeld |
@markwhitfeld If the linked FR ever gets implemented, the ngxsFormDebounce would be deprecated and actions would be dispatched synchronously, |
@FortinFred Do you think we need any updates to the docs around this? |
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
@markwhitfeld |
add a statement about ngxsFormDebounce being ignored for forms with updateOn = 'blur | submit'
used the wrong quotes
Good job! |
make the form-plugin dispatch actions immediately when the form's updateOn is 'blur' or 'submit' or when the ngxsFormDebounce is less than zero
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
#365
Issue Number: 365
What is the new behavior?
When a ngxsFormDebounce is less than zero or when a FormGroup's updateOn property is configured with 'blur' or 'submit', the debounceTime operator will be remove from the valueChanges and statusChanges pipes.
It seems that even with a timer of zero, the state is updated asynchronously after the form has been submited. Removing the operator in the describe situation resolve the issue.
Does this PR introduce a breaking change?
Other information