Fork me on GitHub
#fulcro
<
2020-10-31
>
tobias23:10:08

In Tony's videos, he has some kind of keyboard shortcut for writing a template defsc and then simultaneously editing the keys, query, and ident. Does anyone know what tool he's using?

dvingo23:10:30

intellij live templates

🤯 3
dvingo23:10:54

they're in prefs -> editor -> live templates

tobias23:10:02

Thanks! Do you use it too? If so, any chance you could share your live template? I see that Tony has shared an export of his in the past (https://clojurians-log.clojureverse.org/fulcro/2020-04-19) but unfortunately it's not captured in that log.

dvingo04:11:50

np! I mostly just use these two, you can play around with customizing them to your liking:

(defmutation $name$
  [{:keys [$keys$] :as props}]
  (action [{:keys [state]}]
    (swap! state
      (fn [s]
        (-> s $END$)))))

--------

(defsc $NAME$ [this props]
  {:query []
   :ident :$name$/id
   :initial-state (fn [_] {})}
   [:div "HI"])
   
(def ui-$name$ (c/computed-factory $NAME$))