Lenses zoom into one agent. A lens is (fn [Agent] -> Doc | nil): nil means
it has nothing to say about that agent. observe applies every registered
lens to the focused agent and reports each as a LensSection; a lens that
throws or answers an invalid document is :error and never affects another.
The registry mirrors the presenter seat: an atom of id -> lens fn. Callers serialize mutations.
Lenses zoom into one agent. A lens is (fn [Agent] -> Doc | nil): nil means it has nothing to say about that agent. `observe` applies every registered lens to the focused agent and reports each as a LensSection; a lens that throws or answers an invalid document is :error and never affects another. The registry mirrors the presenter seat: an atom of id -> lens fn. Callers serialize mutations.
(create)A new, empty lens registry atom.
A new, empty lens registry atom.
(ids lenses)Registered lens ids, in id order.
Registered lens ids, in id order.
(observe lens-map agent)One LensSection per lens of LENS-MAP (id -> fn) applied to AGENT, in id order.
One LensSection per lens of LENS-MAP (id -> fn) applied to AGENT, in id order.
(register! lenses id lens)Register LENS under ID on LENSES. Returns ID, or nil when LENS is not a fn.
Register LENS under ID on LENSES. Returns ID, or nil when LENS is not a fn.
(status sections)id -> :lens/status of SECTIONS.
id -> :lens/status of SECTIONS.
(unregister! lenses id)Forget ID on LENSES. Returns ID, or nil when it was not registered.
Forget ID on LENSES. Returns ID, or nil when it was not registered.
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 |