Replies: 3 comments 5 replies
-
MobX tracks anything you access. So by merely reading the properties you
are interested in, it will start observing them. With autorun that happens
for the entire callback function, for react that happens for everything you
access in the first function you pass it.
…On Wed, Apr 5, 2023 at 12:48 PM Xanthus Wong ***@***.***> wrote:
By using deepObserve <https://github.com/mobxjs/mobx-utils#deepobserve>
we can track any nested properties/objects change. However, I don't find
there is one for reaction? May I know if the can track deep
properties/objects change by using reaction?
—
Reply to this email directly, view it on GitHub
<#3677>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBD6DP57VM6DZPJF6C3W7VLZNANCNFSM6AAAAAAWT63NJE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
In that case access all the grandchildren
…On Wed, 5 Apr 2023, 16:38 Xanthus Wong, ***@***.***> wrote:
@mweststrate <https://github.com/mweststrate> thanks for help. However,
for my case, I want to know if any of the object's nested property has been
updated while the object has dynamic shape, by then I will trigger an alert
to user. That means I am not accessing to any specific property of the
object, what I need is whether there is any change under the the grand
children of the objects
—
Reply to this email directly, view it on GitHub
<#3677 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBBIBOESVCKDRZNP4OLW7WGYZANCNFSM6AAAAAAWT63NJE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
4 replies
-
Reflecting on runtime is completely fine, how you traverse is up to you,
for MobX it doesn't matter, it will track with your traversal at runtime.
…On Wed, 5 Apr 2023, 19:27 Xanthus Wong, ***@***.***> wrote:
This could run into infinite circular dependency. Also, as I don't know
the data shape of the target object, it can only be determined at runtime,
it may contains nested object and nested property. The above solution
assumed we know it at coding time and only 1 level of nested object
—
Reply to this email directly, view it on GitHub
<#3677 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBFKOFTCKVBSRSGSMX3W7W2SVANCNFSM6AAAAAAWT63NJE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
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
-
By using deepObserve we can track any nested properties/objects change. However, I don't find there is one for reaction? May I know if the can track deep properties/objects change by using reaction?
Beta Was this translation helpful? Give feedback.
All reactions