This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-22
Channels
- # adventofcode (35)
- # beginners (137)
- # braveandtrue (1)
- # calva (33)
- # cider (40)
- # cljsrn (4)
- # clojure (10)
- # clojure-spec (26)
- # clojure-uk (29)
- # clojurescript (18)
- # core-async (6)
- # cursive (1)
- # emacs (2)
- # figwheel-main (17)
- # fulcro (28)
- # jobs-discuss (4)
- # leiningen (1)
- # lumo (19)
- # off-topic (2)
- # om-next (1)
- # reitit (2)
- # rum (8)
- # spacemacs (19)
- # tools-deps (9)
- # yada (3)
hello, I'm working with some om next code and I'm having the following issue: 1. StructurePage is first rendered when app/current-structure is still loading, so only part of the page is loaded <-- expected 2. all the APIs return and I see the full app/current-structure being populated in the app-state <-- expected 3. StructurePage still only has the app/current-structure that is still loading <-- unexpected code:
(defui StructurePage
static om/IQuery
(query [this]
[{:app/current-structure (om/get-query StructureDetails)}])
Object
(render [this]
(let [details (-> this om/props :app/current-structure)]
(when-not (empty? details)
(structure-details (om/computed details
{:router (-> this om/get-computed :router)}))))))
debugging output:
(-> (om/class->any reconciler StructurePage) om/props)
{:app/current-structure
{:id nil,
:type nil,
:attributes nil,
:loading true,
:updating nil,
:error nil,
:relationships nil,
...
(-> reconciler om/app-state deref)
...
:app/current-structure [:structures "34"],
:structures
{"34"
{:type "structures",
...
any ideas why doesn't the StructurePage sync up with the rest of the app state?
FWIW, other observations,
- if the StructurePage is first rendered after the structure API call returns, then the page is rendered OK
- our reconciler refreshes every 60s. so after 60s, the StructurePage is populated OK and hence rendered fine