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
You may have a need to instantiate multiple stores/models (of the same type) for your particular application. **mobx-store-provider** supports this use case via a unique `identifier` you can pass into the [useProvider](/api/useProvider) and [useStore](/api/useStore) hooks.
Accordingly when I added a new store (definition, not instance) I created a new nested <Provider> (as show on that page). In hindsight I think the RootStore pattern would have been more appropriate, but I wasn't aware of it because that page is titled Multiple stores.
Would you accept a PR to put a ⚠️ on that Multiple stores page that using a single provider and the RootStore approach is better* if you only have one instance of each model type?
When I was new to MST I glossed over
of the same type
(not understanding what it meant) in this:mobx-store-provider/docs/multiple-stores.md
Line 9 in 34788e0
Accordingly when I added a new store (definition, not instance) I created a new nested
<Provider
> (as show on that page). In hindsight I think theRootStore
pattern would have been more appropriate, but I wasn't aware of it because that page is titled Multiple stores.Would you accept a PR to put a⚠️ on that Multiple stores page that using a single provider and the
RootStore
approach is better* if you only have one instance of each model type?* I argue that it's better for this reason.
The text was updated successfully, but these errors were encountered: