You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wg-access-server/website/src/AppState.ts

20 lines
369 B
TypeScript

import { observable } from 'mobx';
import { InfoRes } from './sdk/server_pb';
class GlobalAppState {
@observable
info?: InfoRes.AsObject;
}
export const AppState = new GlobalAppState();
console.info('see global app state by typing "window.AppState"');
Object.assign(window as any, {
get AppState() {
return JSON.parse(JSON.stringify(AppState));
}
});