import { Vue } from 'vue-property-decorator'; import { AsyncLazy } from '@/infrastructure/Threading/AsyncLazy'; import { IApplicationContext } from '@/application/Context/IApplicationContext'; import { buildContext } from '@/application/Context/ApplicationContextProvider'; export abstract class StatefulVue extends Vue { private static instance = new AsyncLazy( () => Promise.resolve(buildContext())); protected getCurrentContextAsync(): Promise { return StatefulVue.instance.getValueAsync(); } }