<code-block>import debounce from 'debounce.js'</code-block>
<section>
<h2>Description</h2>
<p>
Utility module for debouncing user-interactions (or any other events).
</p>
<p>
Its main application are cases where expensive operations like updating or querying data are performed in response to some event like a user typing into a search box.
</p>
<dl>
<code>
<dt>debounce</dt>
<dd>target ⟶ wrapper</dd>
<dd>target, timeout ⟶ wrapper</dd>
</code>
<dd>
A decorator function that takes a target function and returns a wrapper that will only call the target after a set timeout expires.
Repeatedly calling the wrapper while the timeout is running will reset the timeout without calling the target function.
</dd>
</dl>
<h2>Example</h2>
<code-block>
const update = value => expensive_operation(value)