fulcro

Book: http://book.fulcrologic.com, Community Resources: https://fulcro-community.github.io/, RAD book at http://book.fulcrologic.com/RAD.html
xceno 2020-10-19T10:58:58.343100Z

Just to clarify: When I route to a form like this. The :pre-merge hook will run when the component is initialized by the router. So for example on page load. So instead, I should call (fs/add-form-config) in the`:post-mutation` hook of :will-enter. Is that correct? I'm asking because what I observe right now, is that I only end up with a single form with my initial-state, because :pre-merge runs only once on page load.

exit2 2020-10-19T11:51:33.343600Z

I’ve always done fs/add-form-config* in the post mutation. For example, fetch some thing via df/load, then in the post-mutation have something like edit-your-data mutation that threads fs/add-form-config* into the state.

xceno 2020-10-19T11:57:22.343800Z

Alright thanks! That's exactly what I'm doing now.

(defmutation NodeWillEnter [{:keys [target]}]
  (action [{:keys [app state]}]
    (swap! state (fn [s] (-> s
                           (fs/add-form-config* SelectedNode target)
                           (assoc-in [::SelectedNode] target))))
    (dr/target-ready! app target)))
Seems to work well for now

2020-10-19T13:46:22.345600Z

i'm using fulcro 2.8.13 in a web-app that composes many small Fulcro apps. is it possible, given a handle to a mounted Fulcro app (i.e., the return value of fulcro.client/make-fulcro-client) to query into its normalized data, from an external (non-Fulcro) context?

2020-10-19T14:18:28.345700Z

i see i can get access to the internal DB state atom by passing the app's :reconciler to fulcro.client.primitives/app-state -- that should work well enough for my purposes (something of a temporary migration-phase bridge between fulcro-land and other, that won't last very long)

tony.kay 2020-10-19T14:29:12.345900Z

right: db->tree on reconciler

👍 1