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 [x-mills] set a flag to true."
What would be some ways to do this? ie: use an array for samples? write a timeout? etc.