Simple debouncer

I read through your source code and found it a bit confusing. For example am I right to believe that push and pop are meant to increase and decrease time? So why are they not named addTime and removeTime or something similar?

I tried to come up with a very simple solution once before, but my solution is not as minimalistic as yours:

I like the idea of the Bounce type essentially being a counter a lot. This really sparked my interest in this topic again. But as it is right now, I feel like the tricky parts to debouncing are left a bit untouched with your package.

1 Like