Load-time registry of event type definitions.
The registry is mutable process state, so it lives in the shell — the core
(boundary.calendar.core.event) stays pure (helper functions only).
Definitions are registered at namespace load via the defevent macro and
read at runtime via get-event-type / list-event-types.
Load-time registry of event type definitions. The registry is mutable process state, so it lives in the shell — the core (boundary.calendar.core.event) stays pure (helper functions only). Definitions are registered at namespace load via the `defevent` macro and read at runtime via `get-event-type` / `list-event-types`.
(clear-registry!)Reset the registry to an empty map.
Use in tests to avoid inter-test pollution.
Reset the registry to an empty map. Use in tests to avoid inter-test pollution.
(defevent sym definition-map)Define and register an event type.
The body is a map literal that must satisfy EventDef schema.
After macro expansion the definition is automatically registered in the
in-process registry so it is available via get-event-type.
Example:
(defevent appointment-event {:id :appointment :label "Appointment" :schema [:map [:patient-id :uuid] [:room :string]]})
The var appointment-event is bound to the definition map.
The event type is registered under :appointment.
Define and register an event type.
The body is a map literal that must satisfy EventDef schema.
After macro expansion the definition is automatically registered in the
in-process registry so it is available via `get-event-type`.
Example:
(defevent appointment-event
{:id :appointment
:label "Appointment"
:schema [:map
[:patient-id :uuid]
[:room :string]]})
The var `appointment-event` is bound to the definition map.
The event type is registered under :appointment.(get-event-type id)Look up an event type definition by id.
Returns the definition map or nil if not found.
Look up an event type definition by id. Returns the definition map or nil if not found.
(list-event-types)Return a vector of all registered event type ids.
Return a vector of all registered event type ids.
(register-event-type! definition)Register an event type definition in the in-process registry.
Args: definition - EventDef map
Returns the definition map.
Register an event type definition in the in-process registry. Args: definition - EventDef map Returns the definition map.
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 |