Fork me on GitHub
#fulcro
<
2020-08-02
>
lgessler18:08:47

does anybody have a uism for forms sitting around? still learning the uism package and it'd be nice to have something to work off of

grant19:08:40

https://github.com/fulcrologic/fulcro-rad uses them for all the forms, if you want to check that out.

fulcro 1
lgessler19:08:33

oh awesome, ty

lgessler19:08:23

i'm also wondering--if i want to have my reusable form state machine make reference to form-specific mutations (e.g. save-user, save-product, ...) what's the best way to hand the reference to that remote mutation to the uism? i can't seem to find a discussion of this in the docs. i guess one option is to put it in the form class's config (`(defsc ProductEditForm [...] {:ident ... :save-mutation save-product} ...) ) but maybe there's a better way

tony.kay16:08:55

Note that you only really need one save…the form diffs are normalized minimal diffs. One save covers them all. See RAD for that as well.

tony.kay16:08:11

security can simply be an additional layer

tony.kay16:08:53

but yes, what you are suggesting is what I’d recommend for making component-centric mutations…you could also pass them in the event data to uism begin! and through those mutation names in local store of the UISM with uism/store.

dvingo18:08:49

and I do that exactly - store the mutation on using sm/store and then invoke it using sm/retrieve

lgessler23:08:27

thank you both, it helped to see some examples! I ended up writing my own, posting here for posterity https://github.com/lgessler/glam/blob/4d3a336c8e0f6d50531de7ec739c659f44e7cac1/src/main/glam/client/ui/common/forms.cljs#L134L229