Add better description for skooma/bind
This commit is contained in:
parent
0103592665
commit
e6e158b2f4
1 changed files with 8 additions and 2 deletions
|
@ -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 ⟶ new-element</dd>
|
<dd>...data ⟶ 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 ⟶ new-element</dd>
|
<dd>...data ⟶ 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
|
||||||
|
|
Loading…
Reference in a new issue