This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-06-03
Channels
- # announcements (12)
- # beginners (44)
- # boot (27)
- # calva (73)
- # cider (1)
- # clj-kondo (9)
- # cljdoc (9)
- # cljs-dev (15)
- # cljsrn (6)
- # clojure (90)
- # clojure-dev (5)
- # clojure-europe (4)
- # clojure-ireland (3)
- # clojure-italy (22)
- # clojure-mexico (2)
- # clojure-nl (8)
- # clojure-uk (32)
- # clojurescript (12)
- # core-async (2)
- # cursive (16)
- # data-science (10)
- # datascript (3)
- # datomic (44)
- # emacs (17)
- # events (4)
- # graalvm (1)
- # hoplon (5)
- # jackdaw (17)
- # keechma (11)
- # nrepl (7)
- # off-topic (24)
- # re-frame (19)
- # reitit (4)
- # rewrite-clj (2)
- # robots (9)
- # shadow-cljs (20)
- # sql (12)
- # testing (4)
- # tools-deps (23)
- # vim (55)
hi can someone tell me what is difference between
:
and ::
i am checking other peoples code sometimes uses single colon sometimes double colon: `[::events/initialize-db]
:foo
will be a keyword with no namespace i.e. just :foo
::foo
will create a keyword namespaced by the current namespace.
::alias/foo
will create a keyword namespaced by a referred and aliased namespace in the current ns (see @mkvlr's comment below)
So if you are in app.events
, and you write ::foo
it will be expanded to :app.events/foo
.
Namespaced keywords help to avoid collisions between data, and became much more popular after clojure.spec was released, as each spec is associated with a namespaced keyword.
given the following require ::events/initialize-db
would expand to :com.my.events/initialize-db
oop sorry of course my bad, corrected
what is the correct way to debug re-frame project. I used re-frame template to start I did some stuff and it doesn't render anymore. No error no logs just an empty page how can I investigate what's wrong with my code
So, no exceptions in the console ?
And a blank page. That sounds like you aren't rendering anything
Perhaps put a (println "rendering")
in the render function you believe should be rendering? (And then look in the console to see if if was run) Just to be sure it is actually being run.
Apart from that sort of thing, re-frame-10x
can be useful
yes you are right. my bad i changed name of rendering function. then that makes sense there is no error 🙂
Are you new to clojure?
If so:
- make sure you install clj-devtools
(that should have happened via re-frame-template`)
- https://cljs.info/cheatsheet/ is useful