- Custom HTML elements are regular functions and can be created and composed functionally with HLisp
- Spreadsheet-like dataflow with the Javelin ClojureScript library. Intuitively model reactive behavior using cells and formulas.
- Interact with the server with the Castra Clojure and ClojureScript library. Define functions on the server, call them from the client.
A simple custom element
Elements and custom elements are regular functions. The function below,
loud, accepts any number of children. It constructs and returns a
div containing the uppercased
A stateful custom element
In this example, the
timer function initializes a Javelin input cell and schedules it for periodic update using
window.setInterval. The text of the returned
div is attached reactively to
seconds through a formula cell created using
defelem is a convenience macro for creating functions that handle attribute arguments naturally.
In this final example,
todo-list is a function that returns an instance of a simple todo list application. The application responds to user input by updating input cell values when DOM events occur.
:change event on the text input is attached to a function that updates the
new-item input cell as keystrokes occur.
:click event on the button is attached to a function that appends the value of
new-item to the end of
todo-items inside a
dosync is a transactional construct that suspends the propagation of new values through the cell graph while updating multiple cells.
todo-items are rendered as
li elements using the
loop-tpl efficiently maps dynamically-sized collections to DOM nodes.