Replies: 1 comment
-
Hey @adampash, in principle decorators are higher order functions, sou you should be able to call In practice it is often more nuanced, mostly depending on the decorator setup of your application (babel / typescript, standard spec or legacy decorators etc). So if calling |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In my application, I use mobx decorators, but also write my own decorators for custom functionality. Sometimes, I need to apply my own decorator and a mobx decorator (e.g., to make an accessor observable). Ideally, I'd like to be able to apply the mobx observability inside of my decorator so I don't have to fill my class definitions with decorator after decorator. So, my question is:
What's the best way to do this? The only way I’ve gotten it to work is with
extendObservable
, but i’m not confident this is the right way to do it.Here's an example of the code I'm using inside a decorator that I've written (in this code,
parentKey
is a dynamic value passed as an argument to the decorator):cc'ing @mweststrate (since you asked me to create an issue! Rather than creating an issue, the repo's issue page suggested that discussion was the right place to put this. :) )
Beta Was this translation helpful? Give feedback.
All reactions