File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
1-js/06-advanced-functions/09-call-apply-decorators/03-debounce/debounce.view Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
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 >
You can’t perform that action at this time.
0 commit comments