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
add allowStateChangesInsideComputed to allow changes inside a computed value #1706
Conversation
I changed the implementation so it only allows it for the current computed level, this is computed -> changes state inside allowStateChangeInsideAction - ok That way it is a bit better contained. |
@xaviergonz I just pushed an alternative solution, not sure whether I do like it better (I do like it better from api perspective, but not sure I like it better from the constraint that is being given up) |
@mweststrate Thanks for taking a look! |
@mweststrate should it go back to the original solution (the one that doesn't give up the constraint) in order to fix mobx-state-tree afterCreate? |
Sorry, yeah that is anyway better than the current one. Still don't really
like it, nasty side effects of laziness... 😋.
Op ma 24 sep. 2018 19:14 schreef Javier Gonzalez <notifications@github.com>:
… @mweststrate <https://github.com/mweststrate> should it go back to the
original solution (the one that doesn't give up the constraint) in order to
fix mobx-state-tree afterCreate?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1706 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABvGhF4pdNNNar3ivy2hvM6ADD5U711dks5ueRMRgaJpZM4WUT6r>
.
|
This reverts commit e15bc78.
Well, it is only to fix that very particular use case :) Don't think people will (or even should) use it too much. |
Improved the unit test to show that: |
@mweststrate I was wondering, does this need to be retrofit to mobx 4 master as well? |
@xaviergonz yes, but no worries, already on it :) |
ah thanks! |
…side a computed value (#1706) * make allowStateChanges allow changes inside computed value in order to fix MST mobxjs/mobx-state-tree#967 * added allowStateChangeInsideComputed * added unit test * small unit test error * safer implementation * Alternative solution * Revert "Alternative solution" This reverts commit e15bc78. * improve unit test * Changed to more predictable restoration
Thanks for keeping on this one! |
Hope to cut a release tomorrow
Op di 25 sep. 2018 om 17:21 schreef Matt Ruby <notifications@github.com>:
… Thanks for keeping on this one!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1706 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABvGhI_zrKAa_rb2DXqSBYq7KJbiKjwNks5uekn3gaJpZM4WUT6r>
.
|
in order to fix MST mobxjs/mobx-state-tree#967