You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see that in the js documentation this is how you link stores
classRootStore{constructor(){this.userStore=newUserStore(this)this.todoStore=newTodoStore(this)}}classUserStore{constructor(rootStore){this.rootStore=rootStore}getTodos(user){// Access todoStore through the root store.returnthis.rootStore.todoStore.todos.filter(todo=>todo.author===user)}}classTodoStore{todos=[]rootStoreconstructor(rootStore){makeAutoObservable(this,{rootStore: false})this.rootStore=rootStore}}
I'm confused as to how I can do this with mobx.
I have a RootStore
classRootStore=RootStoreBasewith_$RootStore;
abstractclassRootStoreBasewithStore {
// Not sure if this is correct either.lateLikesStore likesStore;
RootStoreBase() {
likesStore =LikesStore(this);
}
}
How can I set this up in my LikesStore?
The text was updated successfully, but these errors were encountered:
@fzyzcjy
So it's okay that inside RootStore it's late and not final?
And then I should pass this as RootStore even though it's RootStoreBase. Isn't that wrong though because it actually is the RootStoreBase? Or am I not understanding something?
I see that in the js documentation this is how you link stores
I'm confused as to how I can do this with mobx.
I have a RootStore
How can I set this up in my
LikesStore
?The text was updated successfully, but these errors were encountered: