Liking cljdoc? Tell your friends :D

macaw.util.malli.registry


-with-docclj

(-with-doc the-schema docstring)

Add a :doc/message option to a schema. Tries to merge it in existing vector schemas to avoid unnecessary indirection.

Add a `:doc/message` option to a `schema`. Tries to merge it in existing vector schemas to avoid unnecessary
indirection.
sourceraw docstring

cachedclj

(cached k schema value-thunk)

Get a cached value for k + schema. Cache is cleared whenever a schema is (re)defined with macaw.util.malli.registry/def. If value doesn't exist, value-thunk is used to calculate (and cache) it.

You generally shouldn't use this outside of this namespace unless you have a really good reason to do so! Make sure you used namespaced keys if you are using it elsewhere.

Get a cached value for `k` + `schema`. Cache is cleared whenever a schema is (re)defined
with [[macaw.util.malli.registry/def]]. If value doesn't exist, `value-thunk` is used to calculate (and cache)
it.

You generally shouldn't use this outside of this namespace unless you have a really good reason to do so! Make sure
you used namespaced keys if you are using it elsewhere.
sourceraw docstring

defcljmacro

(def type the-schema)
(def type docstring the-schema)

Like [[clojure.spec.alpha/def]]; add a Malli schema to our registry.

Like [[clojure.spec.alpha/def]]; add a Malli schema to our registry.
sourceraw docstring

explainclj

(explain schema value)

[[mc/explain]], but uses a cached explainer from explainer.

[[mc/explain]], but uses a cached explainer from [[explainer]].
sourceraw docstring

explainerclj

(explainer schema)

Fetch a cached [[mc/explainer]] for schema, creating one if needed. The cache is flushed whenever the registry changes.

Fetch a cached [[mc/explainer]] for `schema`, creating one if needed. The cache is flushed whenever the registry
changes.
sourceraw docstring

register!clj

(register! schema definition)

Register a spec with our Malli spec registry.

Register a spec with our Malli spec registry.
sourceraw docstring

resolve-schemaclj

(resolve-schema the-schema)

For REPL/test usage: get the definition of a registered schema from the registry.

For REPL/test usage: get the definition of a registered schema from the registry.
sourceraw docstring

schemaclj

(schema type)

Get the Malli schema for type from the registry.

Get the Malli schema for `type` from the registry.
sourceraw docstring

validateclj

(validate schema value)

[[mc/validate]], but uses a cached validator from validator.

[[mc/validate]], but uses a cached validator from [[validator]].
sourceraw docstring

validatorclj

(validator schema)

Fetch a cached [[mc/validator]] for schema, creating one if needed. The cache is flushed whenever the registry changes.

Fetch a cached [[mc/validator]] for `schema`, creating one if needed. The cache is flushed whenever the registry
changes.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close