Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a proof of concept of how mobx could help with state management and computed values.
See the _mobx page.
A cube class is created and made observable. It is responsible for holding and loading the data.
It is observable so components decorated with observer will automatically react to changes.
In the demo, hierarchies are computed "lazily", and integrated in the chart. Component relying on the hierarchy
are automatically re-rendered when the data comes in.
The list of dimensions and measures shown is based on the "components" computed property in the cube.
Nice things with mobx:
In the end, I think it could replace both the redux / immer and the zustand, and also the chart states (where computed values would be clearer than the chain of useMemo that we use).
I think urql is here to stay though as it still delivers a client cache for network requests, and this can be helpful (if you reinstantiate a new cube based on the same IRI, the cache will be hit). Urql and mobx seem to be playing nicely enough in the POC.
Our world in data use mobx.
Linear.app use mobx.