This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-03
Channels
- # announcements (5)
- # aws (3)
- # babashka (52)
- # babashka-sci-dev (23)
- # beginners (51)
- # calva (191)
- # clj-commons (18)
- # clj-kondo (11)
- # cljdoc (39)
- # cljsrn (3)
- # clojure (24)
- # clojure-czech (3)
- # clojure-dev (2)
- # clojure-europe (15)
- # clojuredesign-podcast (2)
- # clojurescript (8)
- # conjure (2)
- # core-typed (151)
- # cursive (15)
- # data-science (3)
- # datalevin (4)
- # datomic (8)
- # figwheel-main (21)
- # fulcro (37)
- # gratitude (3)
- # honeysql (1)
- # hyperfiddle (2)
- # introduce-yourself (1)
- # malli (3)
- # membrane (54)
- # off-topic (21)
- # other-languages (4)
- # portal (18)
- # re-frame (12)
- # reagent (7)
- # releases (2)
- # sci (64)
- # spacemacs (14)
- # sql (2)
- # vim (4)
- # xtdb (6)
Hey, trying to execute an event but I get this error when I try:
re-frame: no :event handler registered for: ...
How do I properly register an event. I have an effect defined using reg-fx
which I dispatch in a reg-event-fx
. What am I missing?Events and effects are different things.
You don't dispatch effects, you dispatch events.
In order to use an effect, you return a map with the right keys/values from the handler function registered with reg-event-fx
.
I understand how to use events and effects now and I have that working. I'm coming across another error I haven't experienced before. I'm trying to import a js package, specifically copy-to-clipboard
, like this:
["copy-to-clipboard" :refer [copy]]
However, it fails with an error:
Uncaught TypeError: module$node_modules$copy_to_clipboard$index.copy is not a function
at eval (effects.cljs:66:5)
at re_frame$fx$do_fx_after (fx.cljc:59:23)
at Object.re_frame$interceptor$invoke_interceptor_fn [as invoke_interceptor_fn] (interceptor.cljc:70:6)
at Object.re_frame$interceptor$invoke_interceptors [as invoke_interceptors] (interceptor.cljc:108:24)
at Object.re_frame$interceptor$execute [as execute] (interceptor.cljc:201:8)
at Object.re_frame$events$handle [as handle] (events.cljc:65:14)
at Object.eval [as re_frame$router$IEventQueue$_process_1st_event_in_queue$arity$1] (router.cljc:179:10)
at Object.eval [as re_frame$router$IEventQueue$_run_queue$arity$1] (router.cljc:198:44)
at eval (router.cljc:146:64)
at Object.eval [as re_frame$router$IEventQueue$_fsm_trigger$arity$3]
Any tips?
https://www.npmjs.com/package/copy-to-clipboardFor future reference - you should not ask that in an unrelated thread. This question in #clojurescript would've been more fitting.
But seems like your :require
of that package is incorrect. And on how to import it exactly - refer to the docs of your build tool.
Okay, got it.