This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-17
Channels
- # aws (3)
- # beginners (104)
- # boot (11)
- # calva (3)
- # clj-kondo (1)
- # cljdoc (6)
- # cljs-dev (23)
- # cljsrn (1)
- # clojure (144)
- # clojure-dev (54)
- # clojure-europe (6)
- # clojure-italy (2)
- # clojure-nl (26)
- # clojure-spec (6)
- # clojure-sweden (1)
- # clojure-uk (13)
- # clojurescript (38)
- # core-async (9)
- # cursive (14)
- # data-science (3)
- # datascript (22)
- # datomic (17)
- # figwheel (1)
- # fulcro (4)
- # graphql (6)
- # hoplon (59)
- # jackdaw (2)
- # jobs (6)
- # jobs-discuss (44)
- # juxt (14)
- # leiningen (1)
- # luminus (3)
- # nrepl (3)
- # off-topic (12)
- # re-frame (24)
- # reagent (7)
- # reitit (7)
- # rewrite-clj (1)
- # schema (1)
- # shadow-cljs (37)
- # spacemacs (4)
- # sql (25)
- # testing (12)
- # tools-deps (11)
- # utah-clojurians (1)
@mikethompson many thanks for confirming! That makes sense. Good to know that re-frame-async-flow
exists as well.
I realized though eventually that I misplaced the dispatch before register-handler that had the event. The issue I had was that I wanted to dispatch some events fairly soon after initializing the app. Since the app I'm working on has a lot of events to be registered, it seemed like the event I wanted to dispatch wasn't registered yet so I ended up with this no :event handler registered (yet) error. I just needed to think through the startup sequence and when dispatches were happening. Thanks both @mikethompson and @lilactown for pointing that about registering handler at startup. That helped me figure this out.
is there any tooling similar to events’ dispatch-later
but for effects? i need to fire off an effect after a delay and am wondering if wrapping the body of the effect fn in a js/setTimeout
is the best way.
One option is to have two events, one that schedules the effect and one that triggers it
all right, thanks for confirming
This is maybe more clear than my writing above. 🙂
(re-frame/reg-event-fx
::schedule-some-action
(fn [_ [_ timeout]]
{:dispatch-later [{:ms timeout :dispatch [::do-some-action]}]}))
(re-frame/reg-event-fx
::do-some-action
(fn [_ _]
{:my-effect ....}))
I’ve been having some rogue issues where events or subs that I have created don’t seem to be working. If I move them around in the file, figwheel recompiles them, and they work until I reload the page, but if I load the page fresh, I get
no subscription handler registered for: :joblist. Returning a nil subscription.
i've seen this sort of thing before where i haven't required the namespaces when the project starts
might be worth listing all the key namespaces as requiers in the namespace that acts as your entry point
It seems to me that they are all there. The events namespace, the page namespace and each of the subpages.
I am sure it is probably something knuckleheaded. I had this problem all day yesterday, and it seemed to go away when I did a clean then an uberjar. On to a new namespace today, having the same issue and none of those tricks seem to be helping.
maybe some namespace metadata that tells figwheel to load it, so it gets loaded on a figwheel refresh? might give a clue as to why it's not being loaded first time
you could always drop a print in the subs namespace at the top level to see whether it does really get loaded first time
here's what i usually put in my on-jsload
function:
(defn on-jsload
[]
(rf/clear-subscription-cache!)
(dev-setup)
(mount-root))
i wonder whether you have something similar, that clear-subscription-cache
could be relevantAnything helps, thanks! I have about a dozen other pages that seem to work fine, It’s only the ones I am modifying or refactoring that seem broken.