Fork me on GitHub

@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.


seems reasonable


One option is to have two events, one that schedules the effect and one that triggers it


So you could dispatch-later from the scheduling event


But there’s probably nothing wrong with js/setTimeout either.


all right, thanks for confirming


This is maybe more clear than my writing above. 🙂

 (fn [_ [_ timeout]]
   {:dispatch-later [{:ms timeout :dispatch [::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


i.e. your :main


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
i wonder whether you have something similar, that clear-subscription-cache could be relevant


sorry just throwing out ideas


Anything 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.


I think that clear-subscription-cache is looking fairly promising.


I guess not, broken again. 😉


It seems to run fine in the production compiled jarfile, just not in figwheel.


I had your problem happening to me, and it was because I was destructuring the db the wrong way.. I’m pretty sure it’s not your case but it’s worth to check that you have {:keys [db]} for reg-event-fx and just db for the rest


I did get it fixed. Still not sure exactly how it was fixed or what the root problem was. Annoying, but back on the right track. I was using a new computer with ‘disable caching’ unchecked, so my troubleshooting may have been a bit unproductive..