Fork me on GitHub
#fulcro
<
2020-12-21
>
AJ Snow01:12:29

does anyone know of any fulcro or om.next implementation of infinite scroll functionality?

JAtkins02:12:37

What do you mean? Maybe I'm being naive, but could you not just use fulcro load!s triggered when hitting the bottom of the page? Maybe have them parameterized so the server knows how many segment's you've already loaded?

AJ Snow02:12:04

yeah that's not a bad idea. So I'd need to figure out how to load the first item(s), then add a mutator to when the page hits the bottom, then figure out how to load the next items and which ones need loaded, and then maybe have a handler for when there are no more items? hmm, this sounds like it may take some time.

JAtkins02:12:33

The initial load is relatively standard for fulcro. Depending on your app, that would be something that happens on page load, dynamic router events, or state machine events. Running raw load! s with segments-loaded parameter and post-mutation might do the trick for the rest of your needs.

JAtkins02:12:16

Of course, building a custom mutation for loading this would also not be very hard. Especially with built in ok-action and error-action

JAtkins02:12:52

I dunno. I could also be totally glossing over something important here that makes this hard.

AJ Snow02:12:53

ok, I will see if I can figure this out based on your suggestions. Thank you!

JAtkins02:12:07

np, hopefully it's helpful

tony.kay18:12:13

Same basic logic as in the pagination demo in the book…just don’t do it as pages (append the new items instead), and trigger on scrolls. https://book.fulcrologic.com/#_paginating_large_lists

👍 3
stuartrexking10:12:55

When is the best time to start a uism? Say I have a signup flow that uses a uism, should I start the uism just before I route to the Signup, or should I start it when the app starts up? The template starts the login dialog uism when the app starts, but I think I’d prefer it on demand when required. Thoughts?

myguidingstar10:12:44

imo what is the best depends on the state itself. For session uism where Signup is a part of, you usually want to start it with the app because checking if user has logged in is required in many ui components. If that's not your case then putting it in will-enter sounds fine

👆 3
bbss11:12:23

I am also running into this a bunch lately. It's a question of lifecycle of the state-machine. Do you want it to persist between view switches or not, is it expensive to run at that moment etc. I tie a lot of state machines to the components themselves, with react hooks and useEffect . But the router sounds like a good place to interact with uism too.

tony.kay18:12:55

I agree with both of the above…UISM is a generic tool: you start them when it make sense for the usage at hand. It also doesn’t hurt to start them early…they take little space and no CPU.

JAtkins19:12:17

Is there any blocking issue for blob uploads and rad? I see a ;; Note: not quite done yet in the demo, but everything appears fine.

wilkerlucio21:12:08

hello, question in RAD, I'm trying to find example of how to make a form field as a select, based on some database information, its to select one other entity on the system, is there an example of that (I couldn't find on the RAD docs)?

3
wilkerlucio16:12:09

also on this, I got the form to work (loading data to fill the picker), but when I try to save it says the field is missing, I can see the data flowing with the correct ident in the Fulcro Inspect network. I'm trying to figure what I may be missing in order for this to save, I copied the same structure from the example (forms and attributes), is there something else I need to add to make this relation work on the delta operation?

wilkerlucio20:12:02

figured out, was missing adding the attributes in the attribute list at the end of file :man-facepalming:

wilkerlucio16:12:09

also on this, I got the form to work (loading data to fill the picker), but when I try to save it says the field is missing, I can see the data flowing with the correct ident in the Fulcro Inspect network. I'm trying to figure what I may be missing in order for this to save, I copied the same structure from the example (forms and attributes), is there something else I need to add to make this relation work on the delta operation?