fulcro

Book: http://book.fulcrologic.com, Community Resources: https://fulcro-community.github.io/, RAD book at http://book.fulcrologic.com/RAD.html
tony.kay 2021-04-16T02:46:38.120200Z

It has been a very long time since I looked at recursion in the context of unions (which I almost never use). I’m not sure if I ever planned to support the specific use-case you’re trying (honestly have no memory…4-5 yrs ago). We have pretty solid tests for db->tree, so you’re welcome to take a shot at implementing it.

tony.kay 2021-04-16T02:47:29.120400Z

See the composition cards in the fulcro-3.5 branch ( in progress). Those will be the more ideal items.

tony.kay 2021-04-16T02:47:55.120600Z

not released, but relatively stable, so you use a SHA/git via deps

tony.kay 2021-04-16T02:48:42.120800Z

I’ve actually been talking about these on this channel for the past few weeks.

tony.kay 2021-04-16T05:38:06.121Z

Is the autocomplete used in the demo? I thought I used everything that was supported in the demo. Perhaps you are using the options incorrectly. I don’t remember off the top of my head, which is why I tried to use everything in the demo…could be I overlooked that one, but I know I’ve used autocomplete at some point.

Jakub Holý 2021-04-16T06:53:14.121300Z

I'd do this

(defsc Photo [this {:ui/keys [photo] :as props}]
  {:ident         (fn [] [:component/id ::Photo])
   :query         [:ui/photo]
   :initial-state {:ui/photo :params/photo}
   :route-segment ["photo"]}
  (log/debug "Photo props" props)
  (if photo
    (n/ui-view {:style {:flex 1}}
               (n/ui-text {} "Hello there!!!!!!")
               (n/ui-image {:source {:uri photo}})
               (rne/ui-button {:title       "Accept"
                               :buttonStyle {:height 40}
                               :onPress     (fn [] (js/alert "You pressed the button!"))}))
    (do
      (-> (.requestMediaLibraryPermissionsAsync ImagePicker)
          (.then (fn [resp]
                   (when (.-granted resp)
                     (.launchImageLibraryAsync ImagePicker))))
          (.then (fn [resp]
                   (when (and resp (not (.-cancelled resp)))
                     (m/set-string! this :ui/photo (.-uri resp))))))
      (dom/p "..."))))

Luis Thiam-Nye 2021-04-16T23:56:53.133200Z

I've found some problems with the hooks/use-component function in the fulcro-3.5 branch. Firstly, the initialize? option is given the default binding of true with associative destructuring, but this binding is never used. Instead, the original options map is passed directly to rapp/add-component!, so initialisation of state does not happen by default. I assume it is actually meant to be true by default either in use-component or add-component!. Secondly, the initial-params option is completely ignored for the first comp/get-initial-state call because (or {} initial-params) always evaluates to {}. I believe the or should be omitted, since a default binding has already been specified.