You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, there is no information about which control of the form was updated in the state when the user fill a new value.
Describe the problem you are trying to solve
If some fields are dependents I need to know which one was updated to perform a specific action.
Here is a usecase :
Input : Amount 1
Input : Amount 2
Input : Sum
If I change amount 1, sum needs to be updated.
If I change sum, amount 1 and amount 2 need to be recalculated to be equals to the sum.
To do that knowing the updated field is required.
Describe the solution you'd like
If possible expose a selector we can subscribe to in order to perform an action after the specific field was updated.
// Add subject.next() in error() and subscribe()this._store.dispatch(actions).subscribe({error: ()=>(this._updating=false),complete: ()=>(this._updating=false)});
This discussion was converted from issue #1996 on May 09, 2023 14:39.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Relevant Package
The package is @ngxs/form-plugin
Description
At the moment, there is no information about which control of the form was updated in the state when the user fill a new value.
Describe the problem you are trying to solve
If some fields are dependents I need to know which one was updated to perform a specific action.
Here is a usecase :
Input : Amount 1
Input : Amount 2
Input : Sum
If I change amount 1, sum needs to be updated.
If I change sum, amount 1 and amount 2 need to be recalculated to be equals to the sum.
To do that knowing the updated field is required.
Describe the solution you'd like
If possible expose a selector we can subscribe to in order to perform an action after the specific field was updated.
https://github.com/ngxs/store/blob/fc39b5671ffcf0e27c73f5569e6048b583e63f6a/packages/form-plugin/src/directive.ts
Describe alternatives you've considered
No workarounds founds at the moment.
Beta Was this translation helpful? Give feedback.
All reactions