소스 검색

Weird mob X

master
James McKenzie 3 년 전
부모
커밋
ac49492e17
3개의 변경된 파일31개의 추가작업 그리고 0개의 파일을 삭제
  1. +7
    -0
      MobXLearning/mobx_course/src/stores/data/data-store.ts
  2. +13
    -0
      MobXLearning/mobx_course/src/stores/data/todo-store.ts
  3. +11
    -0
      MobXLearning/mobx_course/src/stores/root-store.ts

+ 7
- 0
MobXLearning/mobx_course/src/stores/data/data-store.ts 파일 보기

@@ -0,0 +1,7 @@
export default class DataStore{
todoStore: TodoStore;

constructor(rootStore: RootStore){
this.todoStore = new TodoStore(rootStore)
}
}

+ 13
- 0
MobXLearning/mobx_course/src/stores/data/todo-store.ts 파일 보기

@@ -0,0 +1,13 @@
import { observable } from "mobx";

class Todo{}

export default class TodoStore {
@observable
list: Todo[];

private rootStore: RootStore;
constructor(rootStore: RootStore){
this.rootStore = rootStore;
}
}

+ 11
- 0
MobXLearning/mobx_course/src/stores/root-store.ts 파일 보기

@@ -0,0 +1,11 @@
import DataStore from "./data/data-store";

class RootStore{
dataStore: DataStore;
uiStore: UiStore;

constructor(){
this.dataStore = new DataStore(this);
this.uiStore = new UiStore(this);
}
}

불러오는 중...
취소
저장