Fork me on GitHub
#clojure-spec
<
2019-11-25
>
vemv16:11:08

Given a ns that goes like this:

(defmulti event-type ...)

(spec/def :some-event (spec/multi-spec event-type ::type))

(defmethod event-type :some-dispatch-value [_]
  (spec/keys :req-un [::login ::email]))

;; ...many other defmethods...
...how to generate :some-events only with :some-dispatch-value type? i.e., exclude all other dispatch values (i.e. the specs coming from other defmethods)

sgerguri23:11:22

(g/generate (s/gen event-type {::type :some-dispatch-value}))

✌️ 4
👍 4
vemv00:11:06

awesomesauce! thanks