Add better description for skooma/bind

This commit is contained in:
Talia 2023-03-06 10:54:34 +01:00
parent 0103592665
commit e6e158b2f4
1 changed files with 8 additions and 2 deletions

View File

@ -270,6 +270,12 @@
<section>
<h2 id="bind">The <code>bind</code> helper</h2>
<p>
Bind is a low-magic abstraction for simple full re-render micro-components.
It takes a function that renders input data into a DOM subtree and returns an update function.
Every call of the update function will trigger a full re-render of the entire subree and replace the old one within the DOM.
</p>
<dl>
<code>
<dt>bind</dt>
@ -281,7 +287,7 @@
<dl>
<dt>Transform function</dt>
<code>
<dd>...data &xrarr; new-element</dd>
<dd>...data &xrarr; element</dd>
</code>
<dd>
A function that takes the current state and returns a new HTML element.
@ -294,7 +300,7 @@
</dd>
<dt>Update function</dt>
<code>
<dd>...data &xrarr; new-element</dd>
<dd>...data &xrarr; element</dd>
</code>
<dd>
A function that passes its arguments to the transform function and