This website works better with JavaScript.
Home
Explore
lain.church
Help
Register
Sign In
lunarised
/
ReactLearning
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Releases
0
Wiki
Activity
Browse Source
Weird mob X
master
James McKenzie
3 years ago
parent
44c66dd781
commit
ac49492e17
3 changed files
with
31 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+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
View File
@@ -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
View File
@@ -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
View File
@@ -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);
}
}
Write
Preview
Loading…
Cancel
Save