Happy and Healthy New Year! @tony.kay Absolutely, it'd be my pleasure to be your video editor. I shall edit out the audio glitches in the videos while @alex-eberts looks into creating notes for the videos.
For my infinite scroll, I want to take one item out of my storage vector (or just read the next item) and add it to the vector of ui items I currently have displayed. would that be best accomplished by a merge!
or transact!
?
I'm thinking I could have an id associated with each item, and then I would call a transact!
where I would pass in the id (or (inc id)
) to load the next one.
Perhaps there's a simpler way though? Maybe load!
? I see there's an targeting/append-to
option which seems like it might fit my use case.
There's also df/load!
...
It seems like there's a lot of different options, but from what I'm reading append-to
is probably the option I'm looking for.
You definitely want to load!
somewhere. I think you don’t want to load an infinite number of things.
load!
with :append-to
sounds reasonable.
BUT
You want to keep the thing that are actually rendered small. Either:
Paginate (which I don’t think you want for infinite scroll 🙂)
Or have a look at virtualized lists in react.
Transact is the most generic operation. Load leverages it. Merge only inserts data you already have. So indeed load! with the right target is best as Bjørn says
I see Tony has previously proposed something like
(load! this :user/posts PostComponent {:target (t/append-to [:user/table id :user/posts] :params {:pathom/context {:user/username "bob" :page n} } )
why does this not work for you?
Not sure what you mean by
> out of my storage vector (or just read the next item) and add it to the vector of ui items
What is a storage vector? Do you mean a vector you have on the backend? That would imply that you indeed need load! since you want to load data from the backend.yeah I'm using vectors to store backend data so it's just a vector of component data. thank you both! I will look into these suggestions
Hi @alexpiers.fp 🙂 I was able to fix two instances of coughs on 1) “Fulcro RAD Structural Overview” at 25:50 and 2) “Building Things with RAD” at 59:00 directly in YouTube Studio (Tony gave me limited edit access to his channel). Happy to let you take over if / when we find other glitches.
Could you do me a favour and check that the fixes went live on YouTube? Thanks! https://youtu.be/H2XY5kdcjGU (RAD Structural Overview).
Building Things with Fulcro RAD : https://youtu.be/P2up8qcDmJs
man load has a lot of options lol
@alex-eberts Yes, just checked, both videos are live on YouTube and the edits are very well done. Thanks for the quick fix!
Hi Everyone - If you come across any audio glitches (coughs, loud pops, etc.) in Tony’s Fulcro videos on YouTube, please post the name of the video, the video link and the timestamp where the glitch occurs to the slack channel and I’ll fix it. Thanks!
when I trigger a load!
, does it also need a corresponding defresolver
like transact!
does?