UNPKG

@polygonjs/polygonjs

Version:

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

16 lines (14 loc) 462 B
import {PolyEventName} from '../../poly/utils/PolyEventName'; export class PolyEventsDispatcher { static dispatchProgressEvent(progress: number, sceneName?: string) { const createEvent = (eventName: string) => { return new CustomEvent(eventName, { detail: { progress, }, }); }; document.dispatchEvent(createEvent(PolyEventName.POLY_PROGRESS)); document.dispatchEvent(createEvent(`${PolyEventName.POLY_PROGRESS}-${sceneName}`)); } }