Document the handle helper
This commit is contained in:
parent
f7b945c083
commit
cdc5978897
1 changed files with 15 additions and 0 deletions
|
@ -314,6 +314,21 @@
|
|||
</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>The <code>handle</code> helper</h2>
|
||||
|
||||
<p>
|
||||
This helper function takes an event handler and wraps it in a new
|
||||
function that calls <code>preventDefault</code> on the event before
|
||||
passing it to the original function.
|
||||
</p>
|
||||
<code-block>
|
||||
html.form(html.button({
|
||||
click: handle(event => console.log("I'm not submitting anything"))
|
||||
}))
|
||||
</code-block>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>The <code>empty</code> constant</h2>
|
||||
|
||||
|
|
Loading…
Reference in a new issue