-
Hello all, I want autorun is called when image is loaded, so I did modeling like below class A {
@observable
private _image: HTMLImageElement;
public getImage() {
return this._image;
}
} For me, making HTMLImageElement type observable data seems not that good, is this valid or is there any better modeling? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Mobx skips converting unknown classes. You can check it by running
No need to use autorun for that. You can collocate event with reaction like this:
|
Beta Was this translation helpful? Give feedback.
Mobx skips converting unknown classes. You can check it by running
console.log(isObservable(this._image))
. It'll givefalse
.No need to use autorun for that. You can collocate event with reaction like this: