Can I just check my assumptions: inside a UISM handler it should be fine to swap!
on the state atom in (-> env ::uism/app ::application/state-atom)
?
I’m doing that and I can see the updated atom change to what I expect via a watcher on the state atom and by derefing it in the handler but the state atom then reverts to the old value (which I can also see happening in the watcher call back)
I don't know. I only know these rules: Make sure not to use transact![!]; use only apply-action and trigger-remote-mutation.
Thanks… I wonder if I’m reading this correctly to mean that I can swap on the state atom: “Your state machine handlers are already an implementation of the client side operations of a mutation, so really what we need is a way to trigger a remote mutation and then trigger events based on the outcome.” …that seems to agree with what you’re saying “Make sure to not use transact!“.
Oh wait, I hadn’t notice apply-action
That’s it, you can’t swap!
you must use uism/apply-action
Thanks @holyjak!