Add better description for skooma/bind

This commit is contained in:
Talia 2023-03-06 10:54:34 +01:00
parent 0103592665
commit e6e158b2f4

View file

@ -270,6 +270,12 @@
<section> <section>
<h2 id="bind">The <code>bind</code> helper</h2> <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> <dl>
<code> <code>
<dt>bind</dt> <dt>bind</dt>
@ -281,7 +287,7 @@
<dl> <dl>
<dt>Transform function</dt> <dt>Transform function</dt>
<code> <code>
<dd>...data &xrarr; new-element</dd> <dd>...data &xrarr; element</dd>
</code> </code>
<dd> <dd>
A function that takes the current state and returns a new HTML element. A function that takes the current state and returns a new HTML element.
@ -294,7 +300,7 @@
</dd> </dd>
<dt>Update function</dt> <dt>Update function</dt>
<code> <code>
<dd>...data &xrarr; new-element</dd> <dd>...data &xrarr; element</dd>
</code> </code>
<dd> <dd>
A function that passes its arguments to the transform function and A function that passes its arguments to the transform function and