I would love a built-in way of debouncing an on-change callback.
cursor.on-change!.debounce 500, -> ...
# or
cursor.on-change arch.helpers.debounce -> ...
# or
curser.on-change 500, -> ...
The last one would be my favorite, since debounces are so common (at least in my uses). If the first argument is an integer instead of a function, the second parameter (the callback) should be debounced by that integer (in milliseconds like set-timeout).
If you need a debounce implementation in LiveScript, this is what I currently use:
I would love a built-in way of debouncing an
on-change
callback.The last one would be my favorite, since debounces are so common (at least in my uses). If the first argument is an integer instead of a function, the second parameter (the callback) should be debounced by that integer (in milliseconds like
set-timeout
).If you need a debounce implementation in LiveScript, this is what I currently use: