Difference between using observable and makeAutoObservable with plain objects #2700
Unanswered
manuschillerdev
asked this question in
Q&A
Replies: 2 comments
-
The first takes the argument as example and construct a new object, the second modifies the object provided. This can affect the binding of for example |
Beta Was this translation helpful? Give feedback.
0 replies
-
Also |
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
-
When using factory functions over classes as mentioned in (https://michel.codes/blogs/mobx6) we can either use
makeAutoObservable
or just the classicobservable
.e.g.
https://codesandbox.io/s/black-pine-p0i21?file=/src/index.js
Please note: this is a pretty simplified example without actions or side effects. Nevertheless, we tested them with both versions as well, and found no differences.
Is there any difference between using
observable
andmakeAutoObservable
when using the factory pattern and plain objects?thanks for any clarification :)
Beta Was this translation helpful? Give feedback.
All reactions