Closed vbylen closed 2 years ago
You currently can't as it complicates types. But I don't see why you shouldn't be able to just change how you setup your store to use createRootStore
instead.
@k-ode please correct me if I'm wrong but does that mean that in the above code all I need to do differently is use RootModel.createRootStore
instead of RootModel.create
?
I'm working on converting some mobx-state-tree examples into using mst-query. It's not complete yet, but you should be able to get a general idea for how this could be done here: https://codesandbox.io/s/books-mst-query-0kljt?file=/src/stores/RootStore.ts
Note how RootStore is created by createRootStore
and bookStore is created by createModelStore
. While CartStore and ViewStore are just normal properties, since they don't handle items with identifiers.
Say the the rootstore was already configured (based on this example):
How should one go about converting it to use
mst-query
?Thanks!