使用 JavaScript能使本网站更好的工作。
首页
探索
lain.church
帮助
注册
登录
lunarised
/
ReactLearning
关注
1
点赞
0
派生
0
代码
工单
0
合并请求
0
版本发布
0
百科
动态
浏览代码
Weird mob X
master
James McKenzie
3 年前
父节点
44c66dd781
当前提交
ac49492e17
共有
3 个文件被更改
,包括
31 次插入
和
0 次删除
分列视图
Diff 选项
显示统计
下载 Patch 文件
下载 Diff 文件
+7
-0
MobXLearning/mobx_course/src/stores/data/data-store.ts
+13
-0
MobXLearning/mobx_course/src/stores/data/todo-store.ts
+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);
}
}
撰写
预览
正在加载...
取消
保存