Fork me on GitHub
#fulcro
<
2021-07-03
>
Timofey Sitnikov21:07:28

Hello Clojurians, have a question. I have a button that when user clicks, the back-end mutation can take a long time to respond because it sends an email. Basically button fires up a mutation. Is there a utility in (defsc ... by which I can know that the current (defsc... is busy waiting on mutation?

tony.kay22:07:50

The most direct way to handle that (if you really want to block) is to put a marker in state (relative to that components…e.g. [:component id :ui/sending?] . In your mutation’s optimistic action, set it to true, and in the ok-action and error-action set it back to false.

😀 3