Fork me on GitHub
#re-frame
<
2019-06-03
>
metehan10:06:37

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]

danielneal10:06:08

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

mkvlr10:06:42

::events/initialize-db is not invalid if events is being required

mkvlr10:06:25

(ns my-test-ns
  (:require [com.my.events :as events]))

mkvlr10:06:47

given the following require ::events/initialize-db would expand to :com.my.events/initialize-db

danielneal10:06:01

oop sorry of course my bad, corrected

metehan11:06:02

thank you very much. it was confusing. now it's clear

metehan11:06:42

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

mikethompson11:06:48

So, no exceptions in the console ?

mikethompson11:06:55

And a blank page. That sounds like you aren't rendering anything

mikethompson11:06:51

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.

mikethompson11:06:28

Apart from that sort of thing, re-frame-10x can be useful

metehan11:06:14

yes you are right. my bad i changed name of rendering function. then that makes sense there is no error 🙂

metehan11:06:56

thanks i'll try re-frame-10x looks good

mikethompson11:06:27

Are you new to clojure?

mikethompson11:06:31

If so: - make sure you install clj-devtools (that should have happened via re-frame-template`) - https://cljs.info/cheatsheet/ is useful

metehan11:06:49

yes i am totally new this will be my first proeject in cljs

👏 4
metehan12:06:04

thank you for the cheatsheet