fennec-fe/src/global.state.ts
Ivan Li 57eb3d317b feat(projects): 左侧项目菜单。
feat: tailwindcss + mobx + apollo.
2021-02-01 22:22:38 +08:00

19 lines
406 B
TypeScript

import { action, makeAutoObservable, observable } from 'mobx';
import { Project } from './generated/graphql';
export class GlobalState {
@observable projects?: Project[];
@observable currentProject?: Project;
constructor() {
makeAutoObservable(this);
}
@action
setCurrentProject(project: Project) {
this.currentProject = project;
}
}
export const globalState = new GlobalState();