Damn it, I'm confused again: If I need a perform remote mutation and depending of what result of that mutation, shuffle things in the state atom. If I do
defmethod mutate 'foo/fire-missiles!
[_ _ _]
{:remote true
:action (fn []
;; read the state,
;; adjust thee state based on value of (get @state 'foo/fire-missiles!)
)}
;; an on the back:
defmethod mutate 'foo/fire-missiles!
[_ _ _]
{:value (fire-missiles-result)}
I thought this would work, but it doesn't as expected. I have to transact it twice.how do I handle things that happen AFTER successful mutation on the server? I need to mutate local state then
I can't seem to be able to do that in :action fn, it happens before remote mutation
or can I anyhow impact other keys from remote mutate method?
something like
defmethod mutate 'foo/fire-missiles! [_ _ _]
{:value {:yes-it-fired true}}
is there a way (without using custom merge fn) to force the novelty to appear in the top-level key :yes-it-fired
?you can send back any novelty you want from a remote mutate
Is there any special way to pass parameters to a read Iām om/force
ing?
oops, scratch that, I had a typo š