MCPcopy
hub / github.com/aframevr/aframe / setEntityAttribute

Method setEntityAttribute

src/core/a-entity.js:543–553  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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.

Callers 1

Calls 2

updateComponentMethod · 0.95
mixinUpdateMethod · 0.95

Tested by

no test coverage detected