UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

2 lines (1 loc) • 514 B
export const LIVE_PLAN_ERROR="A plan is already loaded on this page; call destroy() first (one live plan per page \u2014 see the Switching plans guide).";let e=!1,i=0;const n=[];export function isPlanLive(){return e}export function planGeneration(){return i}export function claimPlanSlot(){if(e)throw new Error(LIVE_PLAN_ERROR);e=!0}export function registerPlanDisposer(t){n.push(t)}export function disposePlan(){if(!e)return;e=!1,i++;let t,r=!1;for(;n.length>0;)try{n.pop()()}catch(o){r||(t=o,r=!0)}if(r)throw t}