This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-07-08
Channels
- # aleph (10)
- # announcements (2)
- # babashka (1)
- # beginners (22)
- # biff (5)
- # calva (1)
- # clj-kondo (46)
- # clj-on-windows (7)
- # clojure (88)
- # clojure-denver (12)
- # clojure-europe (41)
- # clojure-losangeles (1)
- # clojure-norway (6)
- # clojurescript (5)
- # conjure (4)
- # fulcro (13)
- # humbleui (1)
- # hyperfiddle (70)
- # jobs (5)
- # juxt (1)
- # meander (12)
- # off-topic (42)
- # practicalli (6)
- # releases (2)
- # shadow-cljs (12)
- # tools-deps (1)
I need some help understanding shadow.loader/load
. If I load a module with the ns app.foo
, and in the promise callback I immediately call a function which assumes that ns has been require
'd like fulcro's (comp/registry-key->class app :app.foo/Class)
, it returns nil. but it does work if I manually add a delay. why is this part async, and can I wait for it?
I don't really understand the question. the loading of the module is async, so if you await that all code will be available
I don't know what comp/registry-key->class
is or does, so I cannot really answer your question
https://clojureverse.org/t/shadow-lazy-convenience-wrapper-for-shadow-loader-cljs-loader/3841 might be useful?
hadn't seen shadow.lazy, thanks for saving me the trouble of understanding yet another problem 😄
comp/registry-key->class is called as part of the defsc
macro, which defs something and swaps a global atom that should contain the keyword corresponding to the def'd symbol
actually I just realized my mistake: shadow.loader uses a goog.async.deferred, not a promise, I'm using promesa not the interop api so nothing was being awaited... oops
only noticed once the module got fat enough and never questioned that old assumption until now