You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A implementacao completa da funcao nao e tao dificil.
1122
1122
1123
1123
- Para a implementacao de proteger contra clicks acidentais: enquanto eu comecar o time e o time existir, nao importa quantas vezes eu clicar o butao, a funcao de callback nao sera executada. Contudo quando o time termina, e setado para `null`, outro click e permitido.
1124
-
-
1125
-
1126
-
The complete function implementation is not too difficult. Let's summarize here.
1127
-
1128
-
- For the implementation of protecting against accidental clicks: as long as I start a timer and the timer is there, no matter how you click the button, the callback function won't be executed. Whenever the timer ends and is set to `null`, another click is allowed.
1129
-
- For the implementation of a delayed function execution: every call to the debouncing function will trigger an evaluation of time interval between the current call and the last one. If the interval is less than the required, another timer will be created, and the delay is set to the set interval minus the previous elapsed time. When the time's up, the corresponding callback function is executed.
1124
+
- Para a implementacao da executacao da funcao de atraso: toda chamada para a funcao debouncing vai disparar um tempo de intervalo equivalente entre a chamada tual e a ultima chamada. Se o intervalo e menor que o requerido, outro time sera cirado, e o atraso e atribuido ao set interval menos o tempo anterior. Quando o tempo passa, a funcao de callback e executada.
0 commit comments