0.2.0 ⢠Published 5 months ago
html-signals v0.2.0
html-signals
Increase HTML properties to reduce the need of writing JavaScript code
š Work-In-Progress! API is not stable yet and things may change.
š Documentation to appear - see tests or examples for now.
Already supported
send-what
with a single propertysend-to
with query selectorsend-as
with:- "text"
- "html"
- "json" - with unquoted properties only (HTML limitation)
- "fetch-html"
- "fetch-json"
- "fetch-text"
receive-as
with:- "text"
- "html"
- "fetch-html"
- "fetch-json"
- "fetch-text"
send-on
with single eventon-receive
with sync functionon-receive-error
with functionon-send-error
with function$history
as a special target for "send-to", that adds a URL to the browser history - e.g. send-to="div,$history"prevent
- to call preventDefault() on<a>
,<form>
, etc.
Limitations
- JSON content in element properties must have unquoted properties only (HTML limitation)
- ex.:
<span data-todo="{ title: 'Buy coffee', completed: false }" ></span>
- ex.:
- $history must be at the beginning or at the end of "send-to"
License
MIT (c) by Thiago Delgado Pinto