DEV Community

Discussion on: Why and how to manage state for Angular Reactive Forms

Collapse
 
oz profile image
Evgeniy OZ

Consider adding some examples of how this can be used for mentioned cases, like “undo” or “drafts”. From current code examples, it's not obvious what is the difference related to usual form.valueChanges() and form.stateChanges().

Collapse
 
mfp22 profile image
Mike Pearson

I thought it was clear how you might change state in other ways. You've got form state in a reducer, and I assumed everyone could imagine creating another action modifying that state. However, seeing that it's kind of the central point of the article, I should probably add a quick example of how to do it. The point isn't any specific pattern on top, but that it would be easy to add something, so that's what I should show.