mobx icon indicating copy to clipboard operation
mobx copied to clipboard

fix: Allow action field decorators without makeObservable (#3879)

Open jzhan-canva opened this issue 1 year ago • 1 comments

Code change checklist

  • [x] Added/updated unit tests
  • [x] Updated /docs. For new functionality, at least API.md should be updated
  • [x] Verified that there is no significant performance drop (yarn mobx test:performance)

Similar to #3883 (credit to @Obi-Dann ) but add extra handling for @action.bound on field, for example

class A {
  @action.bound
  doSomething = function() {...} // `this` should be bound to instance of class A
}

fix #3879

jzhan-canva avatar Jul 10 '24 05:07 jzhan-canva

🦋 Changeset detected

Latest commit: b6b84df0943db1bc6ba9a3345dfacd5075b3d411

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
mobx Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Jul 10 '24 05:07 changeset-bot[bot]

Hi @Matchlighter I updated doc to explain the difference behaviour between legacy and modern also added a new unit test to demonstrate the difference

jzhan-canva avatar Sep 12 '24 23:09 jzhan-canva