Fork me on GitHub
#re-frame
<
2020-01-09
>
gmercer00:01:18

If I wanted to separate events over a number of namespaces how do I force them to load in the main events namespace ? e.g main is events.cljs, per namespace document/events.cljs and bibliography/events.cljs

lilactown00:01:12

require them

gmercer00:01:31

I still get "re-frame: no :event handler registered for: :edit-bibliography" even though I have required them in the main events.cljs

mikethompson00:01:43

The most likely explanation is that you haven't actually registered them (even though you are sure you have) . OR that you are registering them after their first use. Put a println into your code where the registration is happening, and make sure you are seeing the registration.

(println "I'm registering :edit-bibliography")
(reg-event-db :edit-bibliography
   ....)

gmercer00:01:29

Cheers - adding the println actually surfaced the issue - I hadn't :require'd re-frame/core into the new namespace ...

gmercer00:01:25

clj-kondo still reports the split out namespaces as unused .. do I just have to live with that ?

mikethompson00:01:53

Will have to defer to someone with clj-kondo experience

borkdude08:01:26

That’s right, if you don’t use an alias or refer clj-kondo will not report it as unused, this is exactly for things like registering re-frame events

👀 4