I recently started looking into Lightning Web Components.
Initially, I assumed that track decorator also acts like a change handler, But looks like I was wrong about it.
Is there any functionality in Lightning web components which is equivalent to
<aura:handler name="change" value="{!v.attriute}" action="{!c.handleChange}"/>
Best Answer
No, there is no such equivalent. The intent of LWC is to prevent the various bugs of two-way binding that occurs in Aura. Instead, specify an event handler and respond to those changes:
While there's some missing bits still (which I am assured is coming in the upcoming releases), you'll need to adjust your way of thinking to using events to notify the parent object of changes.
Data destined to be set by a parent component must use
@api
instead of@track
. For your internal data, use@track
to get updates to those values inside your class.