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

Function elFactory

tests/helpers.js:50–63  ·  view source on GitHub ↗
(opts)

Source from the content-addressed store, hash-verified

48 * @returns {Promise}
49 */
50export function elFactory (opts) {
51 let entity = entityFactory(opts);
52 return new Promise(resolve => {
53 if (entity.sceneEl) {
54 if (entity.sceneEl.hasLoaded) { return resolve(entity); }
55 entity.sceneEl.addEventListener('loaded', () => { resolve(entity); });
56 return;
57 }
58 entity.addEventListener('nodeready', () => {
59 if (entity.sceneEl.hasLoaded) { return resolve(entity); }
60 entity.sceneEl.addEventListener('loaded', () => { resolve(entity); });
61 });
62 });
63}
64
65/**
66 * Creates and attaches a mixin element (and an `<a-assets>` element if necessary).

Callers 3

visible.test.jsFile · 0.90
camera.test.jsFile · 0.90
a-entity.test.jsFile · 0.85

Calls 1

entityFactoryFunction · 0.85

Tested by

no test coverage detected