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
Spurred by discussion here: #4854. I believe we're overusing MST and it makes our codebase overly complicated.
MST is perfectly adequate for our base data structures (bot, profile, chat, etc) since these structures can change often in the lifecycle of a user session, are very inter-dependent, and need to be persisted across app reloads. MST's features give us solutions to those problems more or less "for free".
There are other pieces of state (permissions for example) that don't change often, don't require persistence, and don't depend on other parts of the state tree. Using MST for this "simpler" state has side-effects and requires hacks that we should seek to eliminate.
It is this "simpler" state that I propose to move out of MST and into either vanilla mobx or React state (or whatever else makes sense). Some candidates for this change:
PermissionStore
HomeStore
NavStore
SearchStore
We already have some stores (like ReportStore) that are written with vanilla Mobx that are good examples of how we can convert the stores I mentioned above.
Spurred by discussion here: #4854. I believe we're overusing MST and it makes our codebase overly complicated.
MST is perfectly adequate for our base data structures (bot, profile, chat, etc) since these structures can change often in the lifecycle of a user session, are very inter-dependent, and need to be persisted across app reloads. MST's features give us solutions to those problems more or less "for free".
There are other pieces of state (permissions for example) that don't change often, don't require persistence, and don't depend on other parts of the state tree. Using MST for this "simpler" state has side-effects and requires hacks that we should seek to eliminate.
It is this "simpler" state that I propose to move out of MST and into either vanilla mobx or React state (or whatever else makes sense). Some candidates for this change:
We already have some stores (like ReportStore) that are written with vanilla Mobx that are good examples of how we can convert the stores I mentioned above.
cc @aksonov @bengtan
The text was updated successfully, but these errors were encountered: