Replies: 1 comment 7 replies
-
Could you clarify on this part. Why does turning the function into an action break that? Does the context resolve wrongly or something like that. What, ugly, potentially work is marking the function already as being an action, or prewrapping it as action. E.g. we do keep a flag about things being actions, and we are / should use that to avoid double wrapping: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/core/action.ts#L51 |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to upgrade
mobx-task
to support MobX v6, however, I am running into an issue due toobservable
and friends wrapping theTask
function in an action, losing the task state.The following test fails due to the
.pending
property beingundefined
.https://github.com/jeffijoe/mobx-task/blob/24704082d91723e51bc8b426d3181e0ac5e02217/src/__tests__/task.test.ts#L235-L246
Would it be possible to add a feature that allows you to bail out of the auto-conversion?
Example:
This would also apply to decorators.
Without this, I am unsure how to upgrade the library to support v6.
Beta Was this translation helpful? Give feedback.
All reactions