π[FEATURE]: for @ngxs/form-plugin : Add information on which control was updated
matndev opened this issue Β· comments
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.
// Add subject.next() in error() and subscribe()
this._store.dispatch(actions).subscribe({
error: () => (this._updating = false),
complete: () => (this._updating = false)
});
Describe alternatives you've considered
No workarounds founds at the moment.