Closed artparks closed 7 years ago
Am also seeing this error. Have you found any workaround? Here is a screenshot, I add the letter "D" to the "name" field and it fires twice
You did not compose a reducer for the form.
const rootreducer = composeReducers(
defaultFormReducer(),
combineReducers({
foo: fooReducer,
bar: barReducer
})
);
Yep, sorted. Thanks.
This is a...
What toolchain are you using for transpilation/bundling?
ngc
Environment
NodeJS Version: 7.8.0 Typescript Version: 2.2.2 Angular Version: 4.2.2 @angular-redux/store version: 6.4.5 @angular/cli version: 1.0.6 OS: mac os
Link to repo showing the issue
https://github.com/artparks/forms-actions
Expected Behaviour:
Just one action to be fired when the forms are updated
Actual Behaviour:
Two actions are fired, one with the payload set correctly to the new state of the input, then immediately another one after this whose payload is the previous state.
Stack Trace/Error Message:
n.a
Additional Notes:
I've replicated the setup shown in the example repo, but cannot prevent this issue. It seems that when the
this.form.valueChanges
callback is fired inconnect.ts
, the action published causes this observable to immediately fire again. If I remove the call to publish the action in the callback, it only fires once. I assume when the field is updated via NgModel this causes the second firing of the action. I cannot see why this is happening or how to prevent it, especially when this example is so similar to the example that does work.