deepObserve vs toJS
#3208
-
Hi all, I'm new to Mobx. I'm trying to get my head around the difference between mobx-utils/deepObserve and using toJS in autorun. toJS should let us detect all the changes to an object. How is deepObserve different and in what instance?
|
Beta Was this translation helpful? Give feedback.
Answered by
urugator
Dec 1, 2021
Replies: 2 comments 1 reply
-
If you modify multiple properties in Could help: #1207 (comment) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
TechAkayy
-
also toJS deepclones clones the entire object, which can be overkill and
even confusing, unless you need a deep defensive copy.
…On Wed, Dec 1, 2021 at 12:51 PM akkayy ***@***.***> wrote:
Thanks a bunch!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3208 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAN4NBCSJYCGYQDAZT6GZ2DUOYK63ANCNFSM5JDQW6WQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
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
If you modify multiple properties in
action
it will result in multiple invocations ofdeepObserve
vs single invocation ofautorun
.Could help: #1207 (comment)