Closed garrettg123 closed 4 years ago
It is not recommended because as soon as you modify something without an action (unprotected) then action capturing + replication won't ensure they end in the same state. E.g., if you have a sever that captures actions and sends them to clients to be replicated, yet this server does mutations outside of actions, then the clients will get out of sync eventually.
mobx-keystone does support something similar, "runUnprotected", which allows a piece of code to do mutations without requiring an action. Would that serve you in your use case?
Closing due to inactivity, feel free to reopen if needed
I'm not sure if MK supports this, but MST has an
unprotect(store)
function. I know it's not recommended, but I used it after getting frustrated with not being able to trigger actions on other branches. To be honest, I'm not sure why this isn't recommended. Again, great work, just posing the question in the hopes that it helps others as well.