mobx-task
mobx-task copied to clipboard
Upgrade to MobX v6
Upgrades to the library to support MobX 6. We had to wrap the task in an action to prevent MobX from automatically converting it to an action.
BREAKING CHANGE: The decorator will break when a MobX decorator is used on the same method.
Closes #32
Coverage remained the same at 100.0% when pulling f2f25786850e2b61cc1895e9d25ebfa2aab6c337 on mobx-6 into 24704082d91723e51bc8b426d3181e0ac5e02217 on master.
:tada: This PR is included in version 3.0.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
@jeffijoe Awesome news! Does it work with mobx's makeObservable method?
I am not sure since I haven't used it, but I don't see why not, try it out and let me know!
Yeah, I checked it and unfortunately, it doesn't - mobx throws an Invalid annotation error. If I find any solution, I'll post it here
My recommendation is to use property initializers like this:
class MyClass {
myTask = task(async () => ...)
}
Thank you, that is what I'll do!