This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-09
Channels
- # announcements (1)
- # aws-lambda (3)
- # babashka (6)
- # beginners (91)
- # bristol-clojurians (5)
- # calva (25)
- # chlorine-clover (8)
- # cider (6)
- # clj-kondo (13)
- # cljdoc (10)
- # cljsrn (1)
- # clojure (80)
- # clojure-berlin (6)
- # clojure-europe (29)
- # clojure-nl (4)
- # clojure-spec (18)
- # clojure-uk (51)
- # clojurescript (41)
- # conjure (55)
- # cursive (3)
- # datomic (58)
- # emacs (9)
- # events (1)
- # figwheel-main (2)
- # fulcro (29)
- # graphql (12)
- # helix (4)
- # jobs (4)
- # klipse (8)
- # london-clojurians (1)
- # malli (5)
- # off-topic (13)
- # portal (9)
- # re-frame (30)
- # shadow-cljs (44)
- # spacemacs (7)
- # specter (3)
- # sql (11)
- # tools-deps (71)
- # windows (1)
- # xtdb (10)
Following along with the example here: https://github.com/metosin/malli#custom-registry
(def registry
(merge
(m/class-schemas)
(m/comparator-schemas)
(m/base-schemas)
{:int (m/fn-schema :int int?)
:bool (m/fn-schema :bool boolean?)}))
(m/validate [:or :int :bool] 'kikka {:registry registry})
; => false
(m/validate [:or :int :bool] 123 {:registry registry})
; => true
It looks like m/fn-schema
no longer exists. I tried using m/-fn-schema
(which does exist) but that didn’t work.
How does this example work with the current code?