@visactor/vrender-core
Version:
```typescript import { xxx } from '@visactor/vrender-core'; ```
17 lines (13 loc) • 502 B
JavaScript
export class Application {}
export const APPLICATION_STATE_SYMBOL = Symbol.for("@visactor/vrender-core/application-state");
function createApplicationState() {
return {
application: new Application
};
}
export function getApplicationState() {
const scope = globalThis;
return scope[APPLICATION_STATE_SYMBOL] || (scope[APPLICATION_STATE_SYMBOL] = createApplicationState()),
scope[APPLICATION_STATE_SYMBOL];
}
export const application = getApplicationState().application;