(const expr)Create an inline constant that will return the exact reference/value every time. This is useful in render fns that
call object constructors such as (Color. 100 100 100). When placing this code inside const, it will become a
constant such that = will return true. (defn get-const [] (const (Color. 100 100 100))) makes
(= (get-const) (get-const)) true.
Create an inline constant that will return the exact reference/value every time. This is useful in render fns that call object constructors such as `(Color. 100 100 100)`. When placing this code inside `const`, it will become a constant such that `=` will return true. `(defn get-const [] (const (Color. 100 100 100)))` makes `(= (get-const) (get-const))` true.
(const-named name expr)Where const generates a random symbol name, const-named takes the symbol name as an argument in name. This is
useful for debugging and stack traces.
Where `const` generates a random symbol name, `const-named` takes the symbol name as an argument in `name`. This is useful for debugging and stack traces.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |