Is there a reason override
doesn't support flow.bound
?
#4522
Unanswered
danawillow
asked this question in
General
Replies: 1 comment 3 replies
-
I think it's supposed to work, there is a test for it: Do you use annotations or experimental decorators or ES decorators? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In our codebase, we have a handful of actions that call async (data fetching) functions, await the response, and store it in a property on the class. We were using flow functions for this, since it keeps the code nice and concise compared to
await
+runInAction
, as per https://mobx.js.org/actions.html#using-flow-instead-of-async--await-.However, we also use subclassing, and one of our subclasses was extended to override a flow method. This gave us a hard-to-debug error message:
Thankfully, after looking at the subclassing docs at https://mobx.js.org/subclassing.html#limitations, we realized
override
isn't supported byflow.bound
, and we were able to fix the issue by changing it to useawait
+runInAction
. Why is thataction
,action.bound
, andflow
are supported but notflow.bound
?Beta Was this translation helpful? Give feedback.
All reactions