Replies: 4 comments 6 replies
-
There are already exposed helper functions like |
Beta Was this translation helpful? Give feedback.
-
Hi @urugator, the point you raise about annotating different fields is exactly the crux. I would like to programmatically add more annotations, but only to fields that have not yet been annotated. The problem is that afaict there is no way (yet) to tell if the field has been annotated or not. |
Beta Was this translation helpful? Give feedback.
-
I think this would work, because I now remember that I used this approach before. I tried to move away from this because I didn't like the multiple calls to makeObservable. I wanted to first set up the annotations, and then call |
Beta Was this translation helpful? Give feedback.
-
You are correct that the code for abstract behaviours doesn't depend on observability. It's agnostic of MobX, which means that there is no |
Beta Was this translation helpful? Give feedback.
-
I have a use-case where (before
makeObservable
is called) I want to add annotations to fields unless if they are already annotated. I see in the mobx code that access tostoredAnnotationsSymbol
would make this possible.Could this symbol be exposed? Or alternatively, could you add a function that allows me to get the existing annotation (if any) for a given field?
Beta Was this translation helpful? Give feedback.
All reactions