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.
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.
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 nowi'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?
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)
right: db->tree
on reconciler