This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-29
Channels
- # babashka (64)
- # beginners (60)
- # calva (10)
- # circleci (3)
- # clj-kondo (62)
- # cljdoc (6)
- # clojars (2)
- # clojure (152)
- # clojure-europe (19)
- # clojure-nl (3)
- # clojure-uk (18)
- # clojurescript (50)
- # clojureverse-ops (12)
- # core-async (21)
- # cursive (6)
- # data-science (1)
- # datomic (17)
- # events (14)
- # fulcro (64)
- # graalvm (20)
- # graphql (5)
- # honeysql (14)
- # jackdaw (3)
- # jobs (1)
- # jobs-discuss (22)
- # kaocha (2)
- # lsp (9)
- # luminus (8)
- # malli (30)
- # meander (31)
- # other-languages (1)
- # polylith (8)
- # re-frame (15)
- # shadow-cljs (85)
- # specter (2)
- # sql (11)
- # tools-deps (56)
- # vim (39)
- # vscode (7)
- # xtdb (16)
is there an malli.util/assoc
that will allow to set the properties and schema of a key
or a different function?
That was part my question I posted https://clojurians.slack.com/archives/CLDK6MFMK/p1627435833075200. I did not found a way of doing it at Malli.
But it is fairly easy to do using m/children
.
If you have a look at my other https://clojurians.slack.com/archives/CLDK6MFMK/p1627471982078700?thread_ts=1627435833.075200&cid=CLDK6MFMK on this channel, I wrote a few utility methods.
One of them is update-child-props
.
It was a first draft, I modified them since then, but even with it, you can do what you want, e.g.
(update-child-props (m/schema [:map [:y {:default 20} int?]]) :y update :default dec)
;; => [:map [:y {:default 19} int?]]
(update-child-props (m/schema [:map [:y {:default 20} int?]]) :y assoc :limit 50)
;; => [:map [:y {:default 20, :limit 50} int?]]
maybe:
(mu/assoc
[:map [:y {:old true} int?]]
[:y {:new true}] string?)
; => [:map [:y {:new true} string?]]
aha, thanks!
Hi, I posted this in the #reitit channel but still did not get any response. No reply on the issue I opened either. Since it is Malli related, I thought perhaps I could get some feedback here. Thanks.
@itaysabato I can take a look at that today/tomorrow
Thank you for this! Looks like it did. I commented on one line that I didn't get, but the rest looks solid to me.
answered. I'm not near computer, if you could verify the old behavior (does it strip extras or not), would help. Thanks.
Sorry, I was away for a few days. Is it still relevant to test the old strip keys behavior? I will soon try the fixed version
quick poke on instrumentation: malli.dev/start!
will now collect function schemas from all public vars from all loaded namespaces.
I would like to add Var-watches too, so any Var change would re-trigger instrumentation of that Var. But didn’t work in the 30min timebox I had for it.
anyway, dx should be better than before. feedback welcome on the instrumention. If anyone has tried that…
goal is to do the first version of pretty error reporting for 0.6.0, to celebrate the two year birthday of the initial demo of that (https://github.com/metosin/malli/issues/19). Making open source 1h here and there isn’t the fastest way to finish stuff 😎
hey all, just started using malli in a new part of my project, and i’m struggling to check if a value is a function
(def Step
[:map {:closed true}
[:uuid uuid?]
[:continue-fn fn?]
[:complete? boolean?]
[:phase keyword?]])
fn?
was added few days ago thou, it was missing. you should depend on the latest sha
ah that’s probably it, i’m using the clojars version
immutable clojars-snapshot of the latest stuff:
➜ ~ clj -Sforce -Sdeps '{:deps {metosin/malli {:mvn/version "0.6.0-SNAPSHOT"}}}'
Downloading: metosin/malli/0.6.0-SNAPSHOT/malli-0.6.0-20210729.141459-4.pom from clojars
btw, @nbtheduke there is a new guide for function schmemas at https://github.com/metosin/malli/blob/master/docs/function-schemas.md
missed that there were further docs, i’ll read over that now