event debouncing: fix bug
event debouncing: fix bug: a task in smol-software-harbor (Harbor dataset). The autosave in src/debounce.js saves stale text: debounce() behaves like a throttle that keeps the first call of a burst. A debounced function must restart its timer on every call and, once the caller has been quiet for…
The task
The autosave in `src/debounce.js` saves stale text: `debounce()` behaves like a throttle that keeps the first call of a burst. A debounced function must restart its timer on every call and, once the caller has been quiet for `waitMs`, run once with the arguments of the last call. Fix it (tests use the fake timers in…
Part of efederici/smol-software-harbor.