UNPKG

can-bind

Version:

Updates one observable value with the value of another observable.

15 lines (12 loc) 702 B
@function can-bind.prototype.updateParent updateParent @parent can-bind.prototype @description Set the parent’s value as if the child had changed. @hide @signature `binding.updateParent(newValue)` @param {*} newValue The parent’s new value. This method sets the parent’s value if it is not currently in an update cycle and the parent’s current value doesn’t already match the new value. Additionally, if the `sticky` option is set to `"childSticksToParent"`, the parent’s value is checked _after_ it’s set; if it doesnt match the childs value, then the child is set to the parents new value. This is useful in cases where the parent might change its own value after being set.