When handling a remote error I have a use case where I want to reset the app state to before the action.
I noticed there is no state-before-action
in the env map passed to error-action
- it is only available in the remote
section - I am passing it to the error-action by swapping it into the fulcro app runtime atom. Is this just an oversight, that the state-before-action
is not available in the error-action
handler?
@danvingo just an oversight…the logic for that is in the http://book.fulcrologic.com/#_result_action default result action. Just look at the code, it is very simple once you read that part of the book. I’d accept a PR, and you can also just override the built-in one with one patched to your needs.
Thanks Tony. I'll look into making a PR.
I don't know if this is a bug or not, but I've been trying to get past an issue for a while now to no avail.
If I have a defrouter
set up to point to some component test
I run into an issue.
test
's initial state has one component that it grabs initial state from, X.
test
grabs the initial state of X
twice with two different sets of static data. call the sets S1
and S1
.
In test
's body, if I call the factory ui-x
on S1
and S2
then S2
's result is copied into S1
.
to be more specific, whatever data I passed into X
for S1
is essentially overridden and instead of test
's body displaying S1
and S2
it just displays S2
twice. (the maps passed into the body look identical).
I have found that the issues goes away if I switch the :query
from [... {:test/S1 (comp/get-query X)...}
to [... :test/S1 ...]
.
I will write up an example gist tomorrow, but if anyone recognizes a potential cause in the meantime help would be appreciated.
I’m running into an issue with pessimistic transactions — I’m calling
(comp/transact! this [(a) (b)] {:optimistic? false})
But b
never gets called …
I added debug logging at the end of a
on the server, and in its ok-action / error-action
but my logging at the beginning of b is never triggered..
If i re-order them, both get called — anyone run into anything similar before?
I really recommend not using those, but I'm not aware of any bugs
Sorry, not using which aspects? Optimistic: false?
Correct
That is a legacy feature. You should instead just do logic in action handlers of a
👍 makes sense, thanks!