Is there efficient way to retrieve model with identifier from store?
I have array of elements in the store with identifier property and I would like to find element by its id. Obviously I could do linear time lookup with find but I would like to avoid that. I could change array to map but semantically this is wrong for this model. Is there any…
How to make volatile model/reference field?
I want to add selection field in a model which should be array of references. If I add this to model selection: types.array(types.reference(Todo)) then I have some undesirable side-effects like selection is being saved/loaded in snapshots and also changes to selection are…
How can I display a comment after creating it?
I want to be able to create a comment and then display it with the rest of the comments without having to refresh the page. The problem is that whenever I create a comment, all of the properties are undefined (except for the body property which I am sending from the form) which…
Recursive async action
I have a service that executes a task that takes some time. The service has a REST endpoint that I can hit to get the progress status of the task. I've modeled the status as a value in my MST store. I want to kick off an action that will hit this REST endpoint every few seconds…
What happens when state is updated while still calculating values?
Imagine I have a long dependency chain of calculated values. What will mobx-state-tree do if, while still calculating the views/calculated values, some of the dependencies (state) of that chain changes? Will it continue to solve the original equations, and then re-calculate with…
How to handle several sources of truth?
Hey all. What would be the best setup provided I have several sources of truth (GraphQL endpoints) that need to be queried. Im using MST and would like to add mst-gql. Also the GraphQL entity models can have the same name across those endpoints