* Deals with updates on entity-specific attributes (i.e., components and mixins). * * @param {string} attr * @param {string} oldVal * @param {string|object} newVal
(attr, oldVal, newVal)
| 541 | * @param {string|object} newVal |
| 542 | */ |
| 543 | setEntityAttribute (attr, oldVal, newVal) { |
| 544 | if (COMPONENTS[attr] || this.components[attr]) { |
| 545 | this.updateComponent(attr, newVal); |
| 546 | return; |
| 547 | } |
| 548 | if (attr === 'mixin') { |
| 549 | // Ignore if `<a-node>` code is just updating computed mixin in the DOM. |
| 550 | if (newVal === this.computedMixinStr) { return; } |
| 551 | this.mixinUpdate(newVal, oldVal); |
| 552 | } |
| 553 | } |
| 554 | |
| 555 | /** |
| 556 | * When mixins updated, trigger init or optimized-update of relevant components. |
no test coverage detected