Fork me on GitHub

kill sexp or just kill works, but how do you paste onto the line below.


So I’m using the IntelliJ “Kill Sexp”, which puts it in the normal copy buffer. So, the key sequence you see me using is: Kill Sexp, Undo, move to new location, OS Paste


I should be using “Copy as Kill”, which doesn’t delete it (and would not need the undo), but I have a strong habit of just using the other because the kb shortcut is easier for me to hit 😄


Now that you’ve asked me to explain it, and it sounds so silly, I’ll probably spend the time making myself use the better shortcut 😜


These are all in settings under Cursive:


I use some non-standard mappings, but that’s where to look to set your own. The Help->Show Cursive Cheat Sheet will show you a more readable version of what they are set to (it is updated when you change them)


Thanks for the detailed answer. I figured you were just going into insert mode and pasting.


I could hear it in the keystrokes.


Newbie question: could someone suggest how to display a modal with fulcro and Semantic UI?


@peterd Are you familiar with Fulcro? If not then the best approach is to learn Fulcro by reading the book and watching the video series That should get you to a point of understanding where you can open a modal.


though Peter already knows these 🙂


Hi @stuartrexking I’m getting there with Fulcro. I have read the book, watched the videos up to the 6th one or so. @holyjak Minimalist’s Guide is fantastic. I have two apps that do some basics. For example, a chess UI but struggle with javascript interop with things like the modal. You can see my modal attempt there. The semantic UI React modal here


bleh…I just use semantic ui react and let them deal with the overall mess of Portals and such.


So then it is just a local attribute like :ui/modal-visible? in the query/props that I can toggle true/false to set the modal open.


See fulcro semantic-ui-wrappers


Otherwise, if you really want to implement it yourself (correctly) you’d use React portals to plop the node onto the root for aria compliance, etc.


Thanks! Since I have no idea what a React portal is, I’ll take your advice and stay away! Though I don’t know Fulcro very well yet, I can see that it is built on solid principles and will be very effective for me once I “get it”. Thanks also for creating it!

👍 1

Wow, that was easy. I had dinner in that time too!

😁 1
Pragyan Tripathi12:02:58

Is there any example which show how to use devcards with fulcro?


look at fulcro-template. it uses them


Actually not decards but Workspaces which is similar


I managed to get this working, mostly copying the code from workspaces. here's an example usage:

(ns app.react-collapse-cards
    [my-app.client.ui.collapsible-view :refer [ui-collapse]]
    [com.fulcrologic.fulcro.components :as c :refer [defsc]]
    [dv.devcards-fulcro3 :as f3]))

(defsc CollapseView [this {:ui/keys [open?] :as props}]
  {:query         [:ui/open?]
   :ident         (fn [_] [::id ::card])
   :initial-state {:ui/open? false}}
    {:on-click #(m/toggle!! this :ui/open?)} "toggle"]
   (ui-collapse {:isOpened open?}
     "Hello world")])

(f3/make-reagent-card CollapseView)
I noticed devcards library code being included in production builds though, and eventually started using storybook instead (

👍 2
Pragyan Tripathi15:02:45

Storybook looks really great.. will give it a try.. thanks 🙂


nice - this setup here, is where I started

Braden Shepherdson19:02:40

I'm still thinking about how to integrate Firestore with Fulcro effectively. Firestore is unusual in that it's not really built for occasional request-response queries, but for streaming. ideally, it would work like this: - app navigates to a page with a list - create a streaming query for a collection from Firestore - burst of "added" events for the current contents - probably merge-component! add/update/delete events into the database? - when the user navigates away from the page, the query can be disconnected again. I don't know Fulcro well enough to know where to put those "mount" and "unmount" hooks, or if that whole approach is misguided.

👍 1

if I were to do that, I would think about where I want things to start listening for data. Of course you cant on every app listen for every state change, but inside of task (consider doing a TODO app here) component for example, you could use hooks to start a FB subscription for the data on that point (and clear up the subscriptions when the component is removed). This way you could do a more fine tuning on the subscriptions, makes sense?


What you described makes sense to me, Braden. You can use React life cycle methods wit Fulcro such as component did mount / unmount for this. (Or React hooks, leveraging the hooks support in F.)

Braden Shepherdson22:02:49

okay, I'll take a look. that's why I asked, I was sure there would be some good place to hook into the lifecycle. I'll hook it into the list component's lifecycle, I suppose.


Hey guys I have the following component

(defsc AccountListItem
  "An account list item"
  [this {:account/keys [id name email active? edit] :as props}]
  {:query [:account/id :account/name :account/email :account/active?
           {:account/edit ['*]}]
   :ident :account/id
   :initLocalState (fn [this _] {:editing? false})}
  (let [editing? (prim/get-state this :editing?)]
    (if editing?
      (account-form props)
       (dom/td name)
       (dom/td email)
                 (if active? "Active" "Inactive")))
        (dom/button {:onClick
                     (fn []
                         {:editing? (not editing?)})
                        (prim/transact! this `[(app.model.account/use-account-as-form {:account-id ~id})]))}
I'm trying to get rid of the `editing?` local state by having a `:account/edit` state on the root which will change when the `edit` button is pressed.  However, when I try to retrieve the value of `:account/edit` on my query I get nil.


My Root query looks like the following:

                             #:account{:edit [*]}]}]}]}]

Alex Piers02:02:38

Normally, you put join in the query only when you want to go one level deeper into the child, because the shape of the query is supposed to match the shape of the ui. Therefore, :account/edit should be a property just like :account/id, :account/name, etc. In Tony's book, he actually gave an excellent example to show you how editing? can be done. Do check this out:


So adding the :account/editing? to my data worked when I want to support multiple rows being edited at the same time. However if I only want 1 row being edited at a time what's best practice? First thing I thought of was write a mutation that toggles all :account/editing? to false and then toggling the 1 record that needs to be edited to true.


ah nvm I think I got it 😄


You could have it at root and use a Link Query to ask for it. Or perhaps better, have it on the parent (table/list component), which would query for it and pass it to each row as a Computed Property.


@holyjak ah there it is, thank you! this will do.

👍 1