Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
ikitommi committed Aug 5, 2024
1 parent 567a562 commit a7d3fde
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions test/malli/demo.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
[malli.dev :as dev]
[malli.experimental :as mx]))

;; via var metadata
(defn kikka
"schema via var metadata"
{:malli/schema [:=> [:cat :int] :int]}
{:malli/schema [:-> :int :int]}
[x] (inc x))

(m/=> kukka [:=> [:cat :int] :int])
(defn kukka
"schema via separate declaration"
[x] (inc x))
;; external malli definition
(m/=> kukka [:-> :int :int])
(defn kukka [x]
(inc x))

(mx/defn kakka :- :int
"inline schemas (plumatic-style)"
[x :- :int] (inc x))
;; inline schemas (plumatic-style)
(mx/defn kakka :- :int [x :- :int]
(inc x))

(comment
(dev/start!)
(dev/stop!))

(comment
(kikka "1")
(kukka 1 2)
(kukka "1")
(kakka "1"))

0 comments on commit a7d3fde

Please sign in to comment.