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.
18 lines
368 B
TypeScript
18 lines
368 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));
|
|
},
|
|
});
|