This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-14
Channels
- # adventofcode (12)
- # aleph (8)
- # announcements (6)
- # babashka (16)
- # beginners (217)
- # biff (7)
- # calva (30)
- # chlorine-clover (4)
- # cider (3)
- # clj-kondo (15)
- # cljdoc (6)
- # clojure (50)
- # clojure-europe (86)
- # clojure-finland (2)
- # clojure-nl (1)
- # clojure-norway (37)
- # clojure-uk (2)
- # clojurescript (8)
- # cursive (10)
- # datomic (13)
- # emacs (1)
- # fulcro (41)
- # helix (1)
- # humbleui (2)
- # joyride (7)
- # juxt (4)
- # lsp (19)
- # off-topic (47)
- # pathom (14)
- # polylith (5)
- # portal (7)
- # reagent (10)
- # releases (4)
- # sci (1)
- # scittle (18)
- # shadow-cljs (54)
- # test-check (2)
- # tools-deps (28)
Can I modify a state transition in UISM before I run it? Something like:
(update-in auth-state-machine
[::uism/states :state/logged-out ::uism/events :event/logged-in ::uism/handler]
#(comp on-login %))
It seems that the old version is being called. on-login
is never calledThe state machine def doesn’t get passed around anywhere, so the code has to look it up
I have a property called ::all-categories
which is a list of all categories, used in multiple places in the app. What is the best way to utilize it? Should I query for [::all-categories '_]
in components?
If it is truly global, then that is a reasonable thing to do. You can also add it to the shared data.
Read carefully. Shared is best for things that change rarely. They don’t have the same UI update guarantees as link queries. In general I use link queries.
It is very often that in Fulcro Inspect Transaction view I see State Before and State After be same revision (e.g. when looking at internal-load!
), is this normal? My diff added diff removed are nil on all transactions. I am trying to track down why a property got removed.
Unfortunately this is a bug in Inspect I introduced when I optimized it to be faster some time ago. I have not had time to fix it.
Normalization is not broken, so you can stop barking up that tree. You should look at: What query did you send (network tab) and what response did you receive. If they match up then things will work.
When I load a picker option it deletes po/query-key
from the DB.
i.e. load works. I’d know if it didn’t because i use Fulcro in 300k lines of production apps 😄
picker options are normalized…there may be some additional login in RAD picker support (don’t remember) that is removing the key from the db
RAD uses pickers by loading the entire table via a link query. It never uses the load key
I have ::all-categories
loaded, the picker uses same load to load them into options cache, but it deletes the ::all-categories
value at the root of DB for some reason
the load works as expected
by that I mean I get the expected value from backend
that would explain that
The link query that RAD uses for picker options is
[::picker-options/options-cache '_]
kinda unfortunate that nukes the value already in place
The fact that it puts it in root at all (when targeting is present) is a legacy thing
if you actually want it in root, you can always include that as one of the targets, but the general idea is that top-level keys should not pollute the root unless it is intended.
so I should load target ::all-categories into all 3 components that need it?
probably best, as I stop using link queries
in one part yes
Yeah I have to think about that
I don’t know what you mean by manually writing that load though. Picker does its own load that I cannot affect target-wise as seen in docs:
* `load-options` - Additional options you wish to pass to the load (optional). Only used if the cache was missing or
stale for the options. Currently you cannot use `:target`, `:params`, or `:post-action`. `::picker-options/remote` can
be used to select the load remote.
I guess if you’re relying on RAD to do the load, then that doesn’t work…you could pull the entire table like RAD reports do
yes and it does have a non-trivial post-action
Thanks I’ll mull this over