This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-11
Channels
- # announcements (7)
- # babashka (125)
- # beginners (45)
- # calva (2)
- # cider (25)
- # clj-kondo (8)
- # clojure (123)
- # clojure-australia (4)
- # clojure-nl (5)
- # clojure-spec (3)
- # clojurescript (15)
- # community-development (6)
- # conjure (3)
- # datomic (6)
- # depstar (1)
- # exercism (1)
- # figwheel-main (5)
- # fulcro (37)
- # honeysql (3)
- # jobs-discuss (1)
- # lsp (79)
- # off-topic (24)
- # pathom (6)
- # schema (1)
- # shadow-cljs (35)
- # spacemacs (9)
- # sql (8)
- # tools-deps (6)
- # vim (9)
- # vrac (1)
- # xtdb (5)
I'm trying to spec a large, complicated map for a bunch of game data. there are several possible states the game might be in, and the fields vary depending on which state we're in. I want a spec something like
(s/def ::state-pregame (s/merge ::state-core (s/keys pregame-specific-things) {::state :states/pregame}))
where the key is that last bit, specifying a particular key and value pair for the pregame state.
oh, TIL about multi-spec
, which is exactly this.