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
{{ message }}
This repository has been archived by the owner on Oct 24, 2021. It is now read-only.
One pattern I think we should suggest to people and I have seen it rarely documented is to use local minimongo collections as a reactive state variable. So instead of using reactive vars or dicts even better is to use local minimongo. You can query stuff on it, you can limit reactivity very precisely to a field you care about and so on. And also it forces you to store data in a EJSON-compatible way and not as complex JavaScript objects you can store into reactive variables which improves reactivity (by default reactive variables have equality defined which makes all references different), and also I think it improves communication between various parts of the code better because you do not have some hidden state inside of a JavaScript object but clearly serialized into local Minimongo collection.
So, we should encourage people to do so and do not be scared of this pattern. Sometimes it feels a bit too big, but I think it is better than some temporary local arrays and stuff like that. And then you have to patch reactivity on top of it.
The text was updated successfully, but these errors were encountered:
I suppose whacking one on a component is also a possibility but I'd be inclined to do that only in special cases (for instance if you want to do a "click here to see changes" UX pattern for a list, where the component would include this.visibilePosts and this.data.posts, and sync the two on click).
One pattern I think we should suggest to people and I have seen it rarely documented is to use local minimongo collections as a reactive state variable. So instead of using reactive vars or dicts even better is to use local minimongo. You can query stuff on it, you can limit reactivity very precisely to a field you care about and so on. And also it forces you to store data in a EJSON-compatible way and not as complex JavaScript objects you can store into reactive variables which improves reactivity (by default reactive variables have equality defined which makes all references different), and also I think it improves communication between various parts of the code better because you do not have some hidden state inside of a JavaScript object but clearly serialized into local Minimongo collection.
So, we should encourage people to do so and do not be scared of this pattern. Sometimes it feels a bit too big, but I think it is better than some temporary local arrays and stuff like that. And then you have to patch reactivity on top of it.
The text was updated successfully, but these errors were encountered: