You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to make a little library for specific kind of workflow with Mobx. For this, I attempted to use Object.create to place some functions on the prototype of future store, to be used afterwards as actions; according to the documentation, this should be possible:
All functions on prototype become autoAction.
Intended outcome:
Functions defined on prototype via Object.create are converted to actions, changes to observable state made in them is done without warnings.
Actual outcome:
Prototype of the object is ignored, changing observables inside functions leads to a warning.
Here's the CodeSandbox, which shows a warning in console on startup.
I'm not sure if this is a real error in code. However, the behavior is currently not complying with the documentation, so something probably should be fixed.
The text was updated successfully, but these errors were encountered:
I'm trying to make a little library for specific kind of workflow with Mobx. For this, I attempted to use
Object.create
to place some functions on the prototype of future store, to be used afterwards as actions; according to the documentation, this should be possible:Intended outcome:
Functions defined on prototype via
Object.create
are converted to actions, changes to observable state made in them is done without warnings.Actual outcome:
Prototype of the object is ignored, changing observables inside functions leads to a warning.
How to reproduce the issue:
Here's the CodeSandbox, which shows a warning in console on startup.
I'm not sure if this is a real error in code. However, the behavior is currently not complying with the documentation, so something probably should be fixed.
The text was updated successfully, but these errors were encountered: