Fork me on GitHub
#fulcro
<
2018-07-08
>
souenzzo12:07:18

This app should work?

(defonce client (atom (fc/new-fulcro-client :networking (net/fulcro-http-remote {:url "//localhost:8080/api"})
                                            :started-callback (fn [app] (df/load app :app/data views/Root)))))
I can see the transit request/reponse and both are ok I have a (prn feed) on render so I can see that app dont re-render after the request the request query is something like [{:app/data [{:app/feed [:feed/id]}]}] and the response {:app/data {:app/feed [{:feed/id 1}]}} sometimes app/feed was printed as {}

tony.kay20:07:58

@souenzzo I’m not sure what you’re trying to do here…you’re not leveraging the actual query engine…this example is broken in a number of ways

tony.kay20:07:52

1. The default URI is “/api”. Specifying a complete URL is not recommended. 2. You should be using initial app state if you want to pre-populate some items for demo purposes, not some global tree of data you plug in in the middle

tony.kay20:07:48

3. Your load is targeting :app/data on the root db node, but that isn’t what you query for

tony.kay20:07:28

I’d recommend watching some of the YouTube videos

souenzzo21:07:57

About 1, i understand, I'm not developing an app form scratch. I want to add a fulcro frontend in a existing app. Not so easy to get / and /api from the main domain. About 2, I dont want initial state. that state is just for test if the render is ok About 3, i need to make (prim/tree->db Root data) work, right?