This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-07
Channels
- # announcements (5)
- # asami (17)
- # aws (11)
- # babashka (67)
- # beginners (90)
- # calva (13)
- # cider (17)
- # circleci (6)
- # clj-kondo (3)
- # clojure (53)
- # clojure-europe (12)
- # clojure-france (8)
- # clojure-germany (3)
- # clojure-losangeles (1)
- # clojure-nl (4)
- # clojure-norway (4)
- # clojure-spec (15)
- # clojure-uk (8)
- # clojurescript (41)
- # cursive (7)
- # data-science (6)
- # datomic (8)
- # emacs (10)
- # exercism (1)
- # figwheel-main (2)
- # fulcro (5)
- # graalvm-mobile (97)
- # graphql (1)
- # hyperfiddle (7)
- # inf-clojure (6)
- # interop (4)
- # introduce-yourself (5)
- # jobs (3)
- # kaocha (3)
- # malli (8)
- # meander (8)
- # music (3)
- # nrepl (7)
- # observability (1)
- # off-topic (45)
- # overtone (2)
- # polylith (63)
- # portal (2)
- # re-frame (26)
- # reveal (8)
- # ring (3)
- # shadow-cljs (56)
- # tools-build (5)
- # vim (11)
- # xtdb (8)
I always forget how to properly use macros in CLJS, I am trying to use guardrails in CLJS with: (:require [com.fulcrologic.guardrails.core :refer [>defn => ?]])
and I keep getting “undeclared var” when compiling
Hm
[com.fulcrologic.guardrails.core :refer-macros [>defn ?] :refer [=>]]
doesn’t work eitherHm, it specifically fails for multiarity >defn
.
If I have
(>defn connect
"My Docs"
([db-name rw?]
[string? boolean? => #(satisfies? Storage %)]
(connect db-name "fulcro" rw?))
([db-name store-name rw?]
[string? string? boolean? => #(satisfies? Storage %)]
(-> (create-fulcro-db db-name store-name)
(p/then (fn [db] (->Connection db store-name rw?))))))
I will get warnings that db-name
is undeclared, rw?
is undeclared, store-name
is undeclared. But if I delete one of the arities the >defn
macro worksOr rather it gives another error…
Ok found the problem, apparently guardrails doesn’t like anon fns as spec:
[string? string? boolean? => #(satisfies? Storage %)]