Functions and macros that create classes with some typical properties and features.
Functions and macros that create classes with some typical properties and features.
(interactive-checked-class name type render)Returns an app-state class with an optional attrs argument and
that renders as (render attrs). The :type attribute, and an
:onchange and a :checked attribute will be preset in attrs that
reflect the current app-state, resp. cause an update of the
app-state to the .checked property of the rendered element.
Returns an app-state class with an optional `attrs` argument and that renders as `(render attrs)`. The `:type` attribute, and an `:onchange` and a `:checked` attribute will be preset in `attrs` that reflect the current app-state, resp. cause an update of the app-state to the `.checked` property of the rendered element.
(interactive-class name render value-event value-extractor & event-actions)Returns an app-state class with an optional attrs argument and arbitrary more arguments.
It renders as (render attrs value & more), where value will be
current app-state of the component and the attrs argument will
contain value-event with an event-handler that calls
value-extractor on the event object and uses the result as the new
app-state. Additional event and function arguments to the macro will
also be preset in attrs with event-handlers that call those
function on the correspondig event object, and then cause the
created component to return an action value as returned by that
function, unless it's nil.
Returns an app-state class with an optional `attrs` argument and arbitrary more arguments. It renders as `(render attrs value & more)`, where `value` will be current app-state of the component and the `attrs` argument will contain `value-event` with an event-handler that calls `value-extractor` on the event object and uses the result as the new app-state. Additional event and function arguments to the macro will also be preset in `attrs` with event-handlers that call those function on the correspondig event object, and then cause the created component to return an action value as returned by that function, unless it's `nil`.
(interactive-value-class name render)Returns an app-state class with an optional attrs and more arguments,
that renders as (render attrs & more). An :onchange and a :value
attribute will be preset in attrs that reflect the current
app-state, resp. cause an update of the app-state to the .value
property of the rendered element.
Returns an app-state class with an optional `attrs` and more arguments, that renders as `(render attrs & more)`. An `:onchange` and a `:value` attribute will be preset in `attrs` that reflect the current app-state, resp. cause an update of the app-state to the `.value` property of the rendered element.
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 |