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've checked documentation and searched for existing issues
I've made sure my project is based on the latest MST version
Fork this code sandbox or another minimal reproduction.
Description
The documentation on addMiddleware says
Middleware can be used to intercept any action is invoked on the subtree where it is attached. If a tree is protected (by default), this means that any mutation of the tree will pass through your middleware.
However, this is not true. When the parent action modify the child directly, the middleware cannot detect the action.
This either needs to be fixed. Or at least the function documentation needs to be updated to reflect the actual behavior.
Bug report
I've checked documentation and searched for existing issues
I've made sure my project is based on the latest MST version
Fork this code sandbox or another minimal reproduction.
Description
The documentation on addMiddleware says
Middleware can be used to intercept any action is invoked on the subtree where it is attached. If a tree is protected (by default), this means that any mutation of the tree will pass through your middleware.
However, this is not true. When the parent action modify the child directly, the middleware cannot detect the action.
This either needs to be fixed. Or at least the function documentation needs to be updated to reflect the actual behavior.
Sandbox link or minimal reproduction code
sandbox
Describe the expected behavior
Click on "modify from parent".
Console should print "action detected"
Describe the observed behavior
Click on "modify from parent".
Console did not print "action detected"
The text was updated successfully, but these errors were encountered: