For properties that should recompute only when the data they depend upon changes, you use the MobX ________ decorator.

  • @action
  • @autorun
  • @computed
  • @observer
To make properties recompute only when the data they depend upon changes, you use the @computed decorator in MobX. This decorator creates a computed property, which automatically updates itself when the observed data changes. The other decorators (@action, @observer, @autorun) serve different purposes and do not create computed properties.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *