-
It is connected with issue: #1935 Is it good idea do this?
|
Beta Was this translation helpful? Give feedback.
Answered by
codeBelt
May 11, 2022
Replies: 2 comments 2 replies
-
Try runInAction. https://mobx.js.org/api.html#runinaction |
Beta Was this translation helpful? Give feedback.
1 reply
-
It might be better class RootStore {
constructor() {
this.userStore = new UserStore(this);
this.authStore = new AuthStore(this);
}
init() {
this.userStore.init();
this.authStore.init();
}
}
class UserStore {
rootStore;
constructor(store) {
this.rootStore = store;
makeAutoObservable(this);
}
init() {
this.rootStore.authStore.token;
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ko22009
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It might be better
UserStore
does not initialize itself. So something like this: