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
I'm interested in making observable an object tree that includes arrays, objects, and instances of classes with properties that should also be made observable. I understand that mobx prefers users do make class instances observable from within the constructor of the classes, but I'd like these classes to not depend on mobx.
Browsing the code, it looks like what I'd want is to be able to write a custom enhancer, which I can then create a custom annotation / decorator for, and use in makeObservable. However, while it's easy to write a custom enhancer, it's hard to turn that into a custom annotation, as most of the machinery there is not exposed by mobx.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm interested in making observable an object tree that includes arrays, objects, and instances of classes with properties that should also be made observable. I understand that mobx prefers users do make class instances observable from within the constructor of the classes, but I'd like these classes to not depend on mobx.
Browsing the code, it looks like what I'd want is to be able to write a custom enhancer, which I can then create a custom annotation / decorator for, and use in makeObservable. However, while it's easy to write a custom enhancer, it's hard to turn that into a custom annotation, as most of the machinery there is not exposed by mobx.
Is there a better way to do achieve what I want?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions