+7
-8
@@ -8,3 +8,2 @@ import {getProp, isSubPath, normalizePath, stringPath} from "../../common.js"; | ||
| let xpath = normalizePath(path); | ||
| let xl = xpath.length; | ||
| let x = xpath.pop(); | ||
@@ -59,6 +58,12 @@ let obj = getProp(this, xpath); | ||
| m.wmh = m.wmh || getNextWM(); | ||
| if ( this.wmh[path[0]] >= m.wmh ) return; | ||
| if (this.wmh[path[0]] >= m.wmh ) return; | ||
| this.wmh[path[0]] = m.wmh; | ||
| if (m.value === m.oldValue && m.action === 'upd' && path.length === 1) return; | ||
| let name = path[0]; | ||
| // Порядок важен, чтобы вызывались сначала внутренние обсерверы компонента, а потом остальные | ||
| let inst = this.constructor; | ||
| if (inst.properties?.[name]?.observer) { | ||
| this[inst.properties[name].observer](this._props[name], m.oldValue, m); | ||
| } | ||
| this.applyEffects(m); | ||
@@ -68,8 +73,2 @@ // Polymer-like notify for upward binds | ||
| //TODO: move to prop mixin as effects | ||
| let inst = this.constructor; | ||
| if (inst.properties?.[name]?.observer) { | ||
| this[inst.properties[name].observer](this._props[name], m.oldValue, m); | ||
| } | ||
| } | ||
@@ -76,0 +75,0 @@ forwardNotify(mutation, from, to) { |
+1
-1
| { | ||
| "name": "polylib", | ||
| "description": "A simple library for creating fast, lightweight web components.", | ||
| "version": "1.1.9", | ||
| "version": "1.1.10", | ||
| "license": "MIT", | ||
@@ -6,0 +6,0 @@ "type": "module", |
36714
0.4%