setValue
Sets the value of the observable property.
This function attempts to update the state with the new value.
If the new
valueis the same as the currentstate, no action is taken, but theonBindCallbackis still invoked.If the
valueis different:It first calls all registered
beforeChangelisteners. If any of these listeners returnfalse, the update is aborted, and the function returns.If all
beforeChangelisteners allow the change (or if there are no such listeners), thestateis updated to the newvalue.After the
stateis updated, all registeredafterChangelisteners are invoked with the old and new values.The
onUpdatedcallback (if provided during construction) is invoked with the newvalue.Regardless of whether the value changed or not, the
onBindCallback(if set viabind) is invoked with the new (or current)value.
Parameters
The new value to set for the property.