I have the following subscription:
(rf/reg-sub
:highlight/result
(fn [query-v]
[(rf/subscribe [:fields/path]) (rf/subscribe [:fields/structure])])
(fn [[fields structure] query-v]
(js/console.log (str "Hi from reg-sub: " (type fields)))
(js/console.log (str "Hi from reg-sub: " (type structure)))
(str (highlight fields structure))))
When I try to print the types above I get Hi from reg-sub: function (meta,cnt...
I expected both types to be a Clojure data structure. Is it to be expected that they are functions? I suspect it is an indication I am doing something wrong. Dunno whatThank you for bothering to reply! It is very kind of you 🙂
I have not had time to work on personal stuff until now, that is why no reply 🙂
You are absolutely correct about dev-config. I wonder why it is not checked in by default.
https://github.com/endrebak/ouija/blob/master/src/cljs/ouija/events.cljs#L61 is where the weirdness happens if anyone is interested in taking a look 🙂
I cannot run your project:
could not find a non empty configuration file to load. looked in the classpath (as a "resource") and on a file system via "conf" system property
It wants dev-config.edn
that hasn't been checked into the repo.
Ah, got it running. And now I realize what's wrong. In hindsight, I should've seen it from the code.
Keywords are functions. That's it. Don't wrap the arguments to js/console.log
in str
- you will see proper types if you're using cljs devtools.
(`js/console.log` accepts any amount of arguments)