Liking cljdoc? Tell your friends :D

com.fulcrologic.rad.options-util

Utilities for interpreting and coping with form/report options.

Utilities for interpreting and coping with form/report options.
raw docstring

?!clj/s

(?! v & args)

Run if the argument is a fn. This function can accept a value or function. If it is a function then it will apply the remaining arguments to it; otherwise it will just return v.

Run if the argument is a fn. This function can accept a value or function. If it is a
function then it will apply the remaining arguments to it; otherwise it will just return
`v`.
sourceraw docstring

?fix-keysclj/s

(?fix-keys v)

In RAD component options that are maps: the map keys always support keywords, but SHOULD allow attributes to be used for convenience. Therefore macros can transform any map keys that are attributes into their qualified key. This function takes a value that can be of any type. IF it detects that it is a map, then it will transform the map keys such that any attributes become their keywords, and any other kind of key is left alone.

In RAD component options that are maps: the map keys *always* support keywords, but SHOULD allow attributes
to be used for convenience. Therefore macros can transform any map keys that are attributes into their
qualified key. This function takes a value that can be of any type. IF it detects that it is a map, then
it will transform the map keys such that any attributes become their keywords, and any other kind of key is
left alone.
sourceraw docstring

ast-child-classesclj/s

(ast-child-classes ast recursive?)

Returns a set of classes that are in the children of the given AST.

Returns a set of classes that are in the children of the given AST.
sourceraw docstring

child-classesclj/s

(child-classes class-or-instance)
(child-classes class-or-instance recursive?)

Returns a de-duped set of classes of the children of the given instance/class (using it's query). An instance will use dynamic queries, but a class may not (depending on usage context in Fulcro).

The recursive? flag (default false) can be used to recurse the query to find all subchildren as well.

Returns a de-duped set of classes of the children of the given instance/class (using it's query). An instance will
use dynamic queries, but a class may not (depending on usage context in Fulcro).

The `recursive?` flag  (default false) can be used to recurse the query to find all subchildren as well.
sourceraw docstring

debounceclj/s

(debounce f tm)

Debounce calls to f to at-most every tm ms. Trailing edge wins. In CLJ this just calls f immediately on the calling thread.

Debounce calls to f to at-most every tm ms. Trailing edge wins. In CLJ this just calls `f` immediately on the calling thread.
sourceraw docstring

form-classclj/s

(form-class registry-key-or-component-class)

Attempt to coerce into a Fulcro component class. If the argument is a keyword it will look it up in Fulcro's component registry, otherwise the argument is return unmodified. May return nil if it is passed nil or the component is not registered at the provided key.

Attempt to coerce into a Fulcro component class. If the argument is a keyword it will look it up in Fulcro's
component registry, otherwise the argument is return unmodified. May return nil if it is passed nil or the
component is not registered at the provided key.
sourceraw docstring

macro-optimize-optionsclj

(macro-optimize-options env options keys-to-fix key-transforms)

Applies standard RAD optimizations to a macro's options map (where things may be symbolic). Returns an updated options map that contains new syntax that must be evaluated.

Fixes anything listed in keys-to-fix by applying opts/?fix-keys, and anything in key-transform.

The returned option map will change the values for keys in the keys-to-fix:

  • If there is an entry in key-transforms {k (fn [v] ...)} then it will use that (the fn should return syntax, since v may be symbolic)
  • Otherwise it will apply opts/?fix-keys iff the value is a map or is symbolic.
Applies standard RAD optimizations to a macro's options map (where things may be symbolic). Returns an updated
options map that contains new syntax that must be evaluated.

Fixes anything listed in `keys-to-fix` by applying `opts/?fix-keys`, and anything in `key-transform`.

The returned option map will change the values for keys in the `keys-to-fix`:

* If there is an entry in `key-transforms` {k (fn [v] ...)} then it will use that (the fn should return syntax, since
  v may be symbolic)
* Otherwise it will apply opts/?fix-keys iff the value is a map or is symbolic.
sourceraw docstring

narrow-keywordclj/s

(narrow-keyword k new-name)

Narrow the meaning of a keyword by turning the full original keyword into a namespace and adding the given new-name.

(narrow-keyword :a/b "c") => :a.b/c

Requires that the incoming keyword already have a namespace.

Narrow the meaning of a keyword by turning the full original keyword into a namespace and adding the given
`new-name`.

```
(narrow-keyword :a/b "c") => :a.b/c
```

Requires that the incoming keyword already have a namespace.
sourceraw docstring

qkeyclj/s

(qkey attr-or-keyword)

Ensure that the argument, which can be the qualified key of an attribute or the attribute itself, is a keyword.

Returns the value if is passed unless it is a map, in which case it returns the value at ::attr/qualified-key.

Ensure that the argument, which can be the qualified key of an attribute or the attribute itself, is a keyword.

Returns the value if is passed unless it is a map, in which case it returns the value at ::attr/qualified-key.
sourceraw docstring

resolve-cljcclj

(resolve-cljc macro-env raw-sym)

Usable in macros. Try to resolve the given raw-sym. If compiling CLJC/CLJS this requires that the raw-sym itself be in a CLJC file so it can be resolved at compile-time.

Usable in macros. Try to resolve the given raw-sym. If compiling CLJC/CLJS this requires that the raw-sym itself be
in a CLJC file so it can be resolved at compile-time.
sourceraw docstring

resolve-keyclj

(resolve-key macro-env k?)

Used by RAD macros to ensure that the given value is a keyword.

Used by RAD macros to ensure that the given value is a keyword.
sourceraw docstring

resolve-keysclj

(resolve-keys macro-env options-map)

Used by RAD macros on options map to resolve keys in option maps at compile time. options-map MUST be a map already.

Used by RAD macros on options map to resolve keys in option maps at compile time. options-map MUST be
a map already.
sourceraw docstring

transform-entriesclj/s

(transform-entries m kf vf)

Convert all of the entries in the given map such that {k v} => {(kf k) (vf v)}

Convert all of the entries in the given map such that `{k v}` => `{(kf k) (vf v)}`
sourceraw docstring

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

× close