Explicit method or implicit method is better in MobX? #2914
Unanswered
deadcoder0904
asked this question in
General
Replies: 1 comment
-
Generally you should perform the smallest possible mutation. That allows fine grained subscriptions - eg if you always replace whole background, then a component that depens only on
You can avoid the copy: |
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
-
I have a
Background
type:I have an
updateBackground
function like:I just realised I can simplify the above function as:
Obviously, reading the 2nd function is much easier. What do you guys prefer? Any disadvantages of using the 2nd one? Or advantages of 1st one?
Beta Was this translation helpful? Give feedback.
All reactions