Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: How to use ObservableGroupMap in MST? #284

Open
tho-graf opened this issue Nov 26, 2020 · 1 comment
Open

Question: How to use ObservableGroupMap in MST? #284

tho-graf opened this issue Nov 26, 2020 · 1 comment

Comments

@tho-graf
Copy link

Hi there,

I do my first little baby steps with mobx / MST and can't get ObservableGroupMap working with MST.
Here is my example. I have an array in my state tree. This is by default an observable array, right?
Is it correct to initialize the ObservableGroupMap in the view function once and read from it in a view function?
Later I call the view function in an autorun. But the length of the (grouped) array is the same for ever.

https://codesandbox.io/s/competent-tu-1jyo8

Can anybody tell me what I am doing wrong?

Cheers
Thomas

@NaridaL
Copy link
Collaborator

NaridaL commented Mar 13, 2021

I had a look at this. The issue seems to be that in MST, list.todos isn't actually an observable array of {done: boolean}, but rather a Proxy around an observable array of MST's ObjectNodes around {done: boolean}.

As far as I can see, for this to work, OGM would need to be changed to add explicit MST support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants