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

Function mixinFactory

tests/helpers.js:73–84  ·  view source on GitHub ↗
(id, obj, scene)

Source from the content-addressed store, hash-verified

71 * @returns {object} An attached `<a-mixin>` element.
72 */
73export function mixinFactory (id, obj, scene) {
74 var mixinEl = document.createElement('a-mixin');
75 mixinEl.setAttribute('id', id);
76 Object.keys(obj).forEach(function (componentName) {
77 mixinEl.setAttribute(componentName, obj[componentName]);
78 });
79
80 var assetsEl = scene ? scene.querySelector('a-assets') : document.querySelector('a-assets');
81 assetsEl.appendChild(mixinEl);
82
83 return mixinEl;
84}
85
86/**
87 * Test that is only run locally and is skipped on CI.

Callers 1

a-entity.test.jsFile · 0.85

Calls 1

setAttributeMethod · 0.45

Tested by

no test coverage detected