Fork me on GitHub
#fulcro
<
2020-01-27
>
Robin Jakobsson14:01:21

Is it possible to cancel the remote side of a mutation, from within the client action? I’m thinking about a undo -button (which is more of a “prevent remote action & undo local action”), and where I would implement that.

tony.kay17:01:38

The action always goes first….hm

tony.kay17:01:45

I’ve never tried that though. See book on the code, but I think it might work

tony.kay17:01:58

unless I’ve closed over something in the tx processing that makes it not 😜

tony.kay17:01:07

You could also make a local-only mutation that conditionally calls a diff mutation that does go remote. OR, you could put logic in the remote that changes if it returns true/false

👍 4
tony.kay17:01:11

you can use the state atom in env to look at the current state, and even see the historical value of state before action ran: http://book.fulcrologic.com/#_the_env

tony.kay17:01:37

So I’d probably recommend the last approach @jakobssonrobin

Robin Jakobsson18:01:23

Thanks for the suggestion, I’ll try that approach :thumbsup: .

tony.kay17:01:08

The tx processing in f3 does those things in order (action, followed by remote(s))

tony.kay18:01:53

@fjolne.yngling Releasing Fulcro 3.1.7 with the patch you need for native template

tony.kay18:01:34

stand by…tests not all passing 😞 I had another patch that changed args on something. Fixing that first

tony.kay18:01:04

@fjolne.yngling so, let me know when that last PR is ready/tested. I merge the others.

🎉 4
fjolne18:01:01

@tony.kay thanks, will add cookies support for native as soon as i get to the laptop