In some frameworks form items that dispatch change events have oldValue and newValue properties on the event. This makes it easy to know if any more changes need to be done.
Ephram has a text template form for his users. When they change the value he receives change events. If the value is different than the original he updates the text fields. If the text has been removed he removes the text fields. If the text has been added he performs another action. He uses the oldValue and newValue to check for these 3 conditions.