Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Middlewares can not detect modification directly made in the parent action #5

Closed
zuhorer opened this issue Sep 19, 2023 · 1 comment

Comments

@zuhorer
Copy link

zuhorer commented Sep 19, 2023

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"

@coolsoftwaretyler
Copy link
Owner

This is actually just a docs issue in MST, not for mst-middlewares. Going to close here and re-tag in MST. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants