This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-26
Channels
- # announcements (2)
- # beginners (46)
- # calva (16)
- # cider (5)
- # clj-kondo (1)
- # cljdoc (11)
- # cljsrn (4)
- # clojure (42)
- # clojure-dev (2)
- # clojure-spec (6)
- # clojure-uk (1)
- # clojurescript (18)
- # cursive (7)
- # datomic (18)
- # duct (1)
- # fulcro (11)
- # graalvm (1)
- # hoplon (9)
- # leiningen (1)
- # off-topic (8)
- # shadow-cljs (16)
- # spacemacs (9)
- # specter (3)
- # sql (33)
- # vim (3)
- # xtdb (8)
Community help wanted: I know the docs say how to do this, but I’m doing so many other things I don’t feel like researching it…how do I make a spec that will report the right thing like this:
(s/dev ::thing (atom-of ::other-spec))
FWIW Alex Miller says it’s a bad idea to spec an atom https://stackoverflow.com/questions/37972074/how-to-clojure-spec-a-reference-type-like-atom
well, but I have an “app” data structure that has things in atoms, and I want to see errors on it when Ipass it
I guess that makes sense. So, drop the nested checks when passing ::app
around, and instead put checks wherever the data in the atoms are used…that’ll work. Gotta love learning new ways of dealing with “alternatives to type checking” 🙂
you can make something like this
https://github.com/tonsky/datascript/blob/master/src/datascript/core.cljc#L401
Where db?
can be a (s/valid? ::-app @app)
possibly, but I think the right thing to do (now) is what Alex is saying in that reference. The deep checking I was doing was overkill and didn’t really lead to anything useful when Ithink about it.
Has anyone had luck getting React hooks to work with fulcro? I've tried putting them in a function component's let binding as I see in https://github.com/fulcrologic/fulcro/blob/feature/react-play/src/main/play/main.cljs, but every time I look at the compiled js the hook gets bound as a var instead of a const. Is there just a trick to it I'm missing?