(derive-state {:keys [active-present? variant-raw progress-raw spinner-attr
overlay-raw]})Derive a stable view-model from raw attribute inputs.
Input keys: :active-present? boolean :variant-raw string | nil :progress-raw string | nil :spinner-attr string | nil (nil = absent → true) :overlay-raw string | nil
Output keys: :active? boolean :variant string :progress number | nil :spinner? boolean :overlay string
Derive a stable view-model from raw attribute inputs. Input keys: :active-present? boolean :variant-raw string | nil :progress-raw string | nil :spinner-attr string | nil (nil = absent → true) :overlay-raw string | nil Output keys: :active? boolean :variant string :progress number | nil :spinner? boolean :overlay string
(normalize-overlay s)Normalise overlay attribute to a valid enum value.
Normalise overlay attribute to a valid enum value.
(normalize-variant s)Normalise variant attribute to a valid enum value.
Normalise variant attribute to a valid enum value.
(parse-bool-default-true s)Parse an attribute that is true when absent or empty, false only when "false".
Parse an attribute that is true when absent or empty, false only when "false".
(parse-progress s)Parse progress attribute to a number 0-100, or nil if absent/invalid.
Parse progress attribute to a number 0-100, or nil if absent/invalid.
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 |