This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-02
Channels
- # announcements (5)
- # beginners (35)
- # calva (15)
- # chlorine-clover (9)
- # clj-kondo (8)
- # clojure (34)
- # clojure-europe (6)
- # clojure-uk (1)
- # clojurescript (4)
- # conjure (23)
- # data-science (2)
- # datalog (6)
- # emacs (1)
- # events (8)
- # figwheel-main (3)
- # fulcro (10)
- # jackdaw (3)
- # joker (1)
- # kaocha (1)
- # malli (4)
- # nrepl (1)
- # off-topic (1)
- # pathom (1)
- # re-frame (4)
- # reagent (2)
- # reveal (11)
- # rewrite-clj (15)
- # rum (1)
- # sci (61)
- # shadow-cljs (1)
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
https://github.com/fulcrologic/fulcro-rad uses them for all the forms, if you want to check that out.

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
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.
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.
I made a state machine for creating and editing entities. I pass the remote mutation as a symbol: https://github.com/dvingo/dv.fulcro-template/blob/master/resources/clj/new/dv.fulcro_template/src/main/app/client/ui/task_item.cljs#L94 and here is the machine: https://github.com/dvingo/my-clj-utils/blob/master/src/main/dv/fulcro_entity_state_machine.cljs
and I do that exactly - store the mutation on using sm/store
and then invoke it using sm/retrieve
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