(id, obj, scene)
| 71 | * @returns {object} An attached `<a-mixin>` element. |
| 72 | */ |
| 73 | export 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. |
no test coverage detected