-
Notifications
You must be signed in to change notification settings - Fork 918
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
Perhaps better way to update ngrx on form.valuechanges() #527
Comments
millbj92
added a commit
to millbj92/angular-ngrx-material-starter
that referenced
this issue
Aug 7, 2021
This was referenced Aug 7, 2021
Submitted a PR for this, btw. Nice catch man! |
Thanks!
…On Sun, Aug 8, 2021 at 3:30 AM Brandon Miller ***@***.***> wrote:
Submitted a PR for this, btw. Nice catch man!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#527 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE5W3GGE7XHMQNGSYHEHKLDT3XFZZANCNFSM4NDBWETQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I noticed in the current form.component.html the following code is used in the template to update the ngrx model:
I found that this triggers multiple and duplicate actions for even a single key entry on an input field. It also triggers the action on clicks within the form when data has not changed. I am wondering if this is by design or whether the duplicate actions are tolerated for the sake of the automatic unsubscribe by using the | async pipe.
If the duplication is tolerated for the sake of the automatic unsubscribe, I think I have a possible improvement. Instead of a function call within the template, the template would just contain the subscription:
but the component would provide for the action to be triggered in a tap operator of the formValueChanges$ observable:
This seems to avoid duplicate actions. Thoughts? Any potential drawbacks to this solution?
The text was updated successfully, but these errors were encountered: