fulcro

Book: http://book.fulcrologic.com, Community Resources: https://fulcro-community.github.io/, RAD book at http://book.fulcrologic.com/RAD.html
donavan 2021-06-18T17:00:23.209Z

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)

✅ 1
Jakub Holý 2021-06-18T17:39:22.209500Z

I don't know. I only know these rules: Make sure not to use transact![!]; use only apply-action and trigger-remote-mutation.

donavan 2021-06-18T18:21:23.209700Z

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!“.

donavan 2021-06-18T18:22:23.209900Z

Oh wait, I hadn’t notice apply-action

donavan 2021-06-18T18:31:13.210100Z

That’s it, you can’t swap! you must use uism/apply-action Thanks @holyjak!

🎉 1