Skip to content

How can i make observable fields provided by a decorator #3401

Answered by urugator
nihil-pro asked this question in Q&A
Discussion options

You must be logged in to vote

I think both of these should work

super(...args);
Reflect.defineProperty(this, 'test', { value: { foo: '', bar: '' }, enumerable: false })
makeObservable(this, { 'test': true })

or

super(...args);
extendObservable(this, { test: { foo: '', bar: '' } })

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@nihil-pro
Comment options

@urugator
Comment options

@nihil-pro
Comment options

@urugator
Comment options

@nihil-pro
Comment options

Answer selected by kubk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants