Fork me on GitHub
#fulcro
<
2020-12-11
>
tony.kay00:12:53

Make sure you check out the DB Explorer tab. The search by ID can be particularly fast/useful when you ahve a lot of nodes and know what you’re looking for. The DB tab gets slow if the db is big

nivekuil01:12:22

fulcro really is conceptually very simple but demands a real understanding of the basics or it will be very very hard. Something like an interactive quiz with "what the state will look like given this code" type qs would probably have been very helpful for me, rooting out bad assumptions and misunderstandings

👍 3
Aleksander Rendtslev03:12:56

It feels amazing when everything works. (text inputs are a lot more responsive than with reagent as well. Really good job with that!).. I am having some trouble figuring out how to tie my changes back to my components again. I’ll do a more thorough read through tomorrow and watch the video. I’m trying to append an “entry” to a list after it has been created in the local database (all local right now). And I narrowed it down to having to use targeting/integrate-ident I’m seeing the entry being added to a list in :component/id -> :entry-list -> :entry-list/entries in fulcro inspect, but it’s not reflected in the app. I’m guessing the identity isn’t properly attached somehow?

(defsc EntryList [_ {:entry-list/keys [entries] :as entry-list}]
  {:ident (fn [] [:component/id :entry-list])
   :query [{:entry-list/entries (comp/get-query Entry)}]
   :initial-state {:entry-list/entries []}}
  (ui/view
    (ui/text (str "They are right here below! " (.stringify js/JSON (clj->js entry-list))))
    (map ui-entry entries)))

(def ui-entry-list (comp/factory EntryList))


(defsc EntryPanel [_ {:user/keys [name]
                      :entry-panel/keys [entry entry-list]}]
  {:query [:user/name
           :entry-panel/entry
           {:entry-panel/entry-list (comp/get-query EntryList)}]
   :initial-state (fn [_] {:user/name "Aleksander"
                          :entry-panel/entry (comp/get-initial-state EntryOverlay)
                          :entry-panel/entry-list (comp/get-initial-state EntryList)})
   :ident (fn [] [:component/id :entry-panel])
   }
  (ui/view {:style (tw :w-full :flex-1 :p-5 :align-start :justify-start)}
           (comp/fragment
             (ui/text {:style (tw :text-sm :mb-1 :text-primary)} "Mon, Nov 17")
             (ui/text {:style (tw :text-2xl :mb-2 :text-primary)} (str  "Good morning, " name))
             (ui/text {:style (tw :text-lg :text-primary)} "What did you eat today??")
             (ui-entry-list entry-list)
             (ui-entry-overlay entry))))

tony.kay16:12:45

definitely watch the video. Depends where the code lives. In a mutation, see the merge-component, integrate-ident, and plain old data munging. For something you loaded, the params support targeting (see book/docstrings). For a mutation’s return value, see mutations ns helpers returning and with-target

genekim21:12:14

THANK YOU @holyjak for your help today — I promise I’ll writeup what I learned in the next day or two, and how you helped me get resolvers and queries working! It really is amazing seeing what Fulcro RAD can do… 🙏🙏 cc @tony.kay

💯 2
holyjak23:12:56

Thank you for the kind words! Helping people with Fulcro is fun. And I hope we can find ways to make the onboarding experience easier for everyone...