UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

16 lines (15 loc) 479 B
"use strict"; import { PolyEventName } from "../../poly/utils/PolyEventName"; export class PolyEventsDispatcher { static dispatchProgressEvent(progress, sceneName) { const createEvent = (eventName) => { return new CustomEvent(eventName, { detail: { progress } }); }; document.dispatchEvent(createEvent(PolyEventName.POLY_PROGRESS)); document.dispatchEvent(createEvent(`${PolyEventName.POLY_PROGRESS}-${sceneName}`)); } }