DEV Community

Discussion on: Mobx Root Store Pattern with React Hooks

Collapse
 
ivandotv profile image
Ivan V.

This pattern is safe if that is what you are asking. Yes the stores are referencing each other, but there are no memory leaks. You could also create a special class (service) that would handle out the references to other stores service.getStoreA() or service.getStore('A') and pass that class to child stores instead of the root store.

Collapse
 
shivamfinzome profile image
Shivam

can you provide an example for these?

Some comments have been hidden by the post's author - find out more