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

Dealing with duplicates in message queue

Let's say I have high-load Q/A forum like stack overflow. Imagine there are only two threads, First and Second. Everytime when someone posts an answer/reply it causes two inserts into message queue. 1. command for insert of the post/reply and 2.…
ooouuiii
  • 289
  • 3
  • 14
0
votes
1 answer

Deboucing async property refresh

I would appreciate your help in the following problem: A have a property in my class lets say string Foo {get;set;} There is a refresh function in the class. There is a long running method inside which updates the Foo = await Task.Run()... etc.…
David Molnar
  • 419
  • 1
  • 6
  • 14
0
votes
0 answers

unable to enter text with debounce

Hey guys i'm trying to get debounce to work with a text search field but I am unable to click and enter text into the field. I am able to enter text into the field and search when removing debounce from the constructor. Heres where I am using…
Phil C
  • 15
  • 1
  • 4
0
votes
2 answers

How to call a local function from another function?

function A { *// Inside function A We have below lines of code to do debouncing* const debounce = (func, delay) => { let debounceTimer return function() { const context = this const args = arguments …
user8764001
0
votes
1 answer

Wait 3 seconds to see if a variable is changed then fire something

Here is a piece of JavaScript Code to do Speech Recognition using Web Speech API. This piece of code is responsible for restarting Speech Recognition after user finished speaking. Now I want to modify this code to give users 3-second chances to…
user8764001
0
votes
1 answer

C for AVR Application - ISR Repetition

I'm trying to get a simple interrupt routine to work on an ATMega328P. There's an LED connected to PD6 and a built-in button on PB7. The LED should blink normally until the button is pressed and then go solid for 1.5s before going back to blinking.…
Eric
  • 49
  • 6
0
votes
2 answers

Debounce and return

I'm having an issue with this piece of code: function aFunction(){ .... var deferred = $q.defer(); debounce(function () { deferred.resolve(service.subscribe0(data)); }, 350); return deferred.promise; } The returned promise is…
Igino Boffa
  • 686
  • 1
  • 9
  • 21
0
votes
0 answers

Trouble debouncing setState in Context (react-native)

I'm rendering a lot of Text components and saving positions (in order to scroll to them), but I would like to improve performance by "bundling" it by a debounce (and are open for other suggestions that would improve performance). ... import…
Norfeldt
  • 8,272
  • 23
  • 96
  • 152
0
votes
2 answers

RXSwift act while debounced

I would like to have an Observable that while debounced (in the time frame where we are still not emitting the value) something else will happen, for example show a spinner. So in my code example I only reference my view AFTER the value is…
Eyzuky
  • 1,843
  • 2
  • 22
  • 45
0
votes
1 answer

Simplest code to handle any key press - 8051

I'm trying to figure out the best approach to my problem. I have an AT89S52 microcontroller with 3 buttons connected to 3 separate GPIO pins so that the microcontroller can perform different functions based on those buttons. I'm trying to write code…
Mike -- No longer here
  • 2,064
  • 1
  • 15
  • 37
0
votes
5 answers

Arduino Interrupt won't ignore falling edge

I'm having some trouble completely debouncing a button attached to to an interrupt. The goal is to have the statement in the void loop() run exactly once when the button is pressed/released. What usually ends up happening is one of two things The…
Dirttraxx
  • 7
  • 1
  • 6
0
votes
1 answer

Javascript > Demultiplex/cache a Promise function call

The Problem: I'm currently using socket.io (serverside) to handle async requests from a client. These requests are being passed through to an upstream service - which is reasonably expensive/slow and rate limited. I would like to demultiplex/cache…
Nick Grealy
  • 24,216
  • 9
  • 104
  • 119
0
votes
2 answers

RxJava debounce operator only showing the last emission on Android

I'm trying to use RxJava on Android to emit a number after 1 second has passed. However, only the last item (7) gets emitted. What am I doing wrong? private Observable getIntegerObservable(){ return…
stcojo
  • 65
  • 7
0
votes
1 answer

Test debounced Vue method with Mocha Chai and Sinon

If I have a Vue component like: import lodash from 'lodash'; export default { //...data, props etc methods: { someFunction: lodash.debounce(function debouncedsomeFunction() { return 'test'; }, 200) } }; How would I go about…
Beau
  • 1,771
  • 1
  • 15
  • 20
0
votes
0 answers

Send and Receive guaranteed bits at correct times using timer - 8051

Not sure how to word the title, but this is my problem. I'm making lazer tag and currently each vest has multiple hit points. In code, I call it streams. What I want to do is that during game play: Each vest will scan its streams or hit points to…
Mike -- No longer here
  • 2,064
  • 1
  • 15
  • 37