This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-30
Channels
- # babashka (1)
- # beginners (86)
- # boot (5)
- # calva (21)
- # cider (26)
- # clj-kondo (10)
- # cljs-dev (5)
- # cljsrn (3)
- # clojure (181)
- # clojure-europe (22)
- # clojure-germany (11)
- # clojure-italy (3)
- # clojure-nl (7)
- # clojure-spec (6)
- # clojure-sweden (6)
- # clojure-uk (65)
- # clojuredesign-podcast (1)
- # clojurescript (71)
- # core-logic (2)
- # cryogen (15)
- # data-science (9)
- # datomic (7)
- # duct (4)
- # emacs (4)
- # events (1)
- # exercism (1)
- # fulcro (136)
- # funcool (1)
- # joker (6)
- # kaocha (3)
- # lambdaisland (28)
- # lumo (3)
- # malli (5)
- # mount (1)
- # off-topic (13)
- # re-frame (14)
- # ring (10)
- # shadow-cljs (20)
- # sql (5)
- # tools-deps (5)
- # tree-sitter (1)
- # uncomplicate (9)
Hi. I am new to re-frame and I am sure this is something silly, but I am getting this, re-frame: no :event handler registered for: :initialize
.
;; events.cljs
(rf/reg-event-fx
:initialize
(fn [_ _]
{:db {:favourite-movies {}
:genres {}
:show-only {:genre-ids #{}
:director-ids #{}}}
:dispatch-n [[:fetch-genres] [:fetch-favourite-movies]]}))
;; core.cljs
(ns app.core
(:require
[app.db]
[app.effects]
[app.events] ;; << required here
[app.subs]
[app.views]
[reagent.dom :as rdom]
[re-frame.core :as rf]))
(defn ^:export init
[]
(rf/dispatch-sync [:initialize])
(render))
There are a whole bunch of errors. Too much to paste here. reg-event-fx
is defined as shown at ns
level.
a whole bunch of errors might mean that some other error in your code is preventing your app.events
namespace from executing, which leads to :initialize
not being registered
I would comment out (render)
from your init
fn and see if those errors persist. if some of them do, then that might lead you to finding what might be causing your app.events
to not execute
Restarted shadow watch just to be sure.
EDIT: Don't know what changed, but restarted shadow a few times and suddenly it worked.
EDIT+: I actually remember changing in shadow-cljs.edn
this line :modules {:main {:init-fn app.core/init}}
to :modules {:app {:init-fn app.core/init}}
. May be the reason why is stopped working. Now I reverted it.