menu

mobx-state-tree

Opinionated, transactional, MobX powered state container combining the best features of the immutable and mutable world for an optimal DX

Channels
Team
Posts
Members
Info
down-caret

Building generic component tree builder

Hey guys! I am in process of writing a "component tree builder". What I mean is basically drag n' drop page builder. My data comes from server as a tree of elements. …

thumbsup
0
message-simple
8

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…

thumbsup
0
message-simple
4

How to enumerable an array from store to new variable?

thumbsup
0
message-simple
2

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…

thumbsup
0
message-simple
2

How to pass dependency injections down to every child nodes ?

My store is composed of different models that are in a tree shape like this : All the types are optional so i can create the store like this : How could I access the env variables on the deepest nodes in the tree ?

thumbsup
0
message-simple
9

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…

thumbsup
0
message-simple
1

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…

thumbsup
0
message-simple
1

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…

thumbsup
0
message-simple
3

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

thumbsup
0
message-simple
1

How to set data for observer array?

i have an array like: dataTags: types.optional(types.array(DataFilter), []) export const DataFilter = types.model({ …

thumbsup
0
message-simple
0