Skip to content

Commit 535a47b

Browse files
committed
1.6.9.3
1 parent 8dc26c7 commit 535a47b

File tree

1 file changed

+24
-0
lines changed
  • 1-js/06-advanced-functions/09-call-apply-decorators/03-debounce/debounce.view

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!doctype html>
2+
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.js"></script>
3+
4+
Funkce <code>handler</code> je volána na tomto vstupu:
5+
<br>
6+
<input id="input1" placeholder="type here">
7+
8+
<p>
9+
10+
Vyčkávací funkce <code>debounce(handler, 1000)</code> je volána na tomto vstupu:
11+
<br>
12+
<input id="input2" placeholder="type here">
13+
14+
<p>
15+
<button id="result">Funkce <code>handler</code> umístí výsledek sem</button>
16+
17+
<script>
18+
function handler(událost) {
19+
result.innerHTML = událost.target.value;
20+
}
21+
22+
input1.oninput = handler;
23+
input2.oninput = _.debounce(handler, 1000);
24+
</script>

0 commit comments

Comments
 (0)