Questions tagged [debouncing]

Debouncing ensures that a handler is not executed too often for an event that may be happening several times per second.

698 questions
0
votes
1 answer

Debounced live search in javascript not executing closure

The code below simulates executing a live search (replaced with console output) via a debounce function. The debounce function is called, but the passed liveSearch function is not. I'm guessing because debounce returns a function which isn't being…
bbodien
  • 1,062
  • 2
  • 10
  • 20
0
votes
0 answers

Lodash debounce: what does "the system time has gone backwards" mean?

Recently I am reading the source code of lodash debounce function. I can't figure out why timeSinceLastCall could be less than 0 in the shouldInvoke method. The comment says that the system time has gone backwards. What does it mean? The source code…
Samuel Gong
  • 157
  • 1
  • 1
  • 7
0
votes
1 answer

Add jQuery to dynamic JS-DOM objects

I'm creating several DOM-Objects with plain JavaScript which are placed into the page after everything is done. Now I'd like to add some different functionality by using jQuery. And add it during the process of creation. As it looks now (plain old,…
Qohelet
  • 1,459
  • 4
  • 24
  • 41
0
votes
1 answer

_lodash debounce not debouncing

Here is my code (angular 2): debouncedFunc = _.debounce(()=>{ console.log('bam') }, 1000, {"leading":true}) click(){ this.debouncedFunc() } this fires off every event with no debouncing. I want to…
dooblr
  • 458
  • 1
  • 5
  • 18
0
votes
1 answer

Debouncing on stm32f4 discovery

void EXTI3_IRQHandler(void){ //Clear the EXTI pending bits NVIC_ClearPendingIRQ(EXTI3_IRQn); EXTI->PR|=(1<<3); count++; } This is a my interrupt routine. if press the button the intterrup occurs and the then count is…
0
votes
1 answer

Debounced function calls delayed but all executed when wait timer ends

I am using debounce in order to implement a 'search as you type' field. I am reading https://css-tricks.com/debouncing-throttling-explained-examples/ and from what I can understand the function should only be called a limited number of times. In my…
George Katsanos
  • 13,524
  • 16
  • 62
  • 98
0
votes
1 answer

Window Resize Event, and Add and Clear Google Map Markers

I'm running into an issue on Chrome in Windows 10 when initializing a sequence of functions, which is initially triggered by the window resize event. The sequence of events can be summarized as such: The window resize event calls initializeMap()…
0
votes
1 answer

What are reasons for the debouncing function implemented in recursion instead of iteration?

In this post we have a snippet of debouncing function: Can someone explain the "debounce" function in Javascript It uses recursion as the algorithm. However, this doesn't seem to fit the typical recursion situation, where each step has a somewhat…
Jinghui Niu
  • 990
  • 11
  • 28
0
votes
0 answers

Observable being sampled is flooding with events

I'm trying to sample the output of a slider in Android. The set up is: A PublishSubject mSubjTrim. In the OnTouchEvent of the slider, I call mSubjTrim.onNext(progress) I create an observable from mSubjTrim public final Observable mObsTrim =…
Magic Marbles
  • 403
  • 2
  • 5
  • 15
0
votes
1 answer

Simple program: How to send duration and time of pushed button?

I have ESP8266 ESP-12E with microswitch connected to GPIO13 (and ground). I want to send (preferably using HTTP POST but I'm open to something else if it's bad choice) duration of time holding down the button and time counting from ESP8266 start to…
Defozo
  • 2,946
  • 6
  • 32
  • 51
0
votes
1 answer

Arduino push button debounce

I need help with debounce of push button. Sometimes it send twice same string to serial link, and I don't know why. Could someone help me, where is a problem? int reading; int exbutton= LOW; unsigned long ddelay= 200; unsigned long last= 0; void…
user3421673
  • 97
  • 1
  • 3
  • 10
0
votes
1 answer

How does live object creation and partial teardown management work in javascript?

What I would like to do is load javascript to create a library of methods in an object and wait until the object is used for the first time before it is actually defined or compiled. I would like to build references to this object before it is…
0
votes
1 answer

Why is the timeout variable shareable in this case?

In the answers to this question someone wisely points out that The timeout variable stays accessible during every call of the produced function even after debounce itself has returned, and can change over different calls. It doesn't quite make…
Jinghui Niu
  • 990
  • 11
  • 28
0
votes
1 answer

Debounce serial commands in nodejs?

I have something feeding commands into a nodejs program through noble (its talking to a BLE device that has a serial service), and I'd like to write a bit of a debounce / smooth. So for example: "If [x-command] comes in more than 2 times in under…
mishap_n
  • 578
  • 2
  • 10
  • 23
0
votes
0 answers

Encoder Debounce VHDL

For practice, I attempted to make a VHDL code to run Rotary encoder hardware. It was full with debounce, quadrature decoder and an up/down counter codes. Unfortunately, when running simulation with a testbench, my results were disappointing so I…