Fork me on GitHub
#fulcro
<
2020-07-31
>
tony.kay00:07:35

should be, though, if I’m remembering (and reading this right):

lgessler00:07:34

fortunately i don't need it--i'm implementing :on-result, :on-ok, and :on-error as tx options for when i need to do a tiny bit of UI work (like make a ui toast) with a result and it's annoying to do it by writing (ok-result ... etc. in the mutation because it's in a different ns

lgessler00:07:56

for posterity though: i just checked in an ok-result and ::txp/options is available in there

Tyler Nisonoff04:07:05

Beginner question: I'm trying to experiment with the RAD demo and wanted to redirect the user to another view (say, the Dashboard container) https://www.youtube.com/watch?v=oQpmKWBm9HE&amp;list=PLVi9lDx-4C_T7jkihlQflyqGqU4xVtsfi&amp;index=15 , I want to do this in the cljs mutation of login (on ok-action), however I can't figure out how to avoid a circular dependency to the component in order to pass that rroute/route-to! I'm not sure if ones supposed to pull UI components into model files for mutations (seems off, but I'm still getting a feel for this all) Is there a better approach?

Tyler Nisonoff13:07:50

maybe this would be part of the UI state machine, rather than the log in mutation? :man-shrugging:

tony.kay14:07:26

you can find components in the component registry by fully-qualified keyword

tony.kay14:07:46

e.g. x.y/C is in there under :x.y/C

tony.kay14:07:44

The registry is there for just that sort of circular dep problem, though be careful that you always use it in a runtime (non-static) context. e.g. (defonce x (comp/registry-key->class :x.y/C)) will likely fail because it might run before the other loads. But (defn getC [] …) will be ok (as long as you don’t, in turn, use it in a static context) 😜

tony.kay14:07:42

yay dynamic languages

Tyler Nisonoff14:07:16

ahh thanks!! I suppose this makes refactoring UI components a bit more fragile, since if you move your component to a new namespace, you have to remember to update the corresponding symbol here, but a test can catch that, and its no less fragile than if you specified the route string directly, and modified your route layer

tony.kay14:07:34

moving things around from ns to ns is rife with difficulties…

tony.kay14:07:41

I don’t love having the registry, but it’s just simply necessary for cases like this, and also cases like dynamic code loading. You cannot refer to something that you don’t load until later…but you can look it up by keyword (that you knew in advance) once its loaded.

Tyler Nisonoff15:07:04

Yeah, I see how it’s probably our best poison to pick from 🙂

zilti11:07:04

Okay what is it with Fulcro/Pathom calling resolvers with nil params when the resolver clearly states it needs a certain param

zilti11:07:59

Why is my resolver from :account/id to :db/id called with nil instead of the :account/id value

tony.kay13:07:50

Ask on #pathom ?