This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-12
Channels
- # beginners (40)
- # boot (2)
- # cider (16)
- # clara (2)
- # cljs-experience (2)
- # clojure (100)
- # clojure-italy (11)
- # clojure-russia (2)
- # clojure-spec (9)
- # clojure-uk (34)
- # clojurescript (36)
- # community-development (3)
- # core-async (4)
- # cursive (4)
- # datascript (1)
- # datomic (20)
- # duct (10)
- # emacs (1)
- # fulcro (2)
- # off-topic (40)
- # onyx (12)
- # overtone (8)
- # portkey (6)
- # quil (1)
- # re-frame (7)
- # ring-swagger (2)
- # shadow-cljs (2)
- # spacemacs (2)
- # test200 (10)
- # tools-deps (16)
- # unrepl (1)
- # vim (24)
Hello! I'm migrating an app from om-next to Fulcro. It's been a very smooth process so far but there's one thing I've got trouble understanding how to do. Is there any way I can control how the fulcro.client.data-fetch/load
should merge the response into the state? From the server I'm returning this response:
{:status 200 :body {:data
{:notes [{:db/id 1, :note/content "some content of the note" ... ],
:notebooks [{:db/id 2, :notebook/title "a title"} ...]}
I solved it in om-next by doing this in the callback to the send function that was passed to the reconciler:
(let [{:keys [data] :as response} (->> (.getResponseText this)(t/read (om/reader)))
{:keys [rewrite]} (om/process-roots data) ]
(callback (rewrite data)))))
I've got the correct response coming from the server, but I don't know how to merge it. So far I've tried like this but it merges the result under :data
(defonce app
(atom (fc/new-fulcro-client :started-callback
(fn [app]
(df/load app :data Root)
(df/load app :notes Root {:target [:notes]})
))))
I'm migrating a fulcro project to use shadowbuild instead of figwheel. I'm doing it by comparing my setup to a default lein new fulcro shadowcljs demo
project, and copying code across (renaming the namespaces as I go). This seems to have gone well except for internationalisation support - both lein and shadowcljs complain about ::i18n namespaced keywords, like (for shadow-cljs
):
adaptdb/ui/root.cljc [line 41, col 41] Invalid keyword: ::i18n/current-locale.
or for lein
:
adaptdb/ui/root.cljc [line 41, col 41] Invalid keyword: ::i18n/current-locale.
Am I missing a file or config setting somewhere? The devcards build is compiled without issue as it has no i18n in it, it's just the main build that causes issues.