The debounce function provided by the API is actually a throttle function

Steps to reproduce

  1. Create a debounced function with a 1000ms timeout
  2. Call that debounced function at an interval less than the timeout

Did you follow the troubleshooting guide? [Y/N]

Y

Y

Expected result

You should never see the debounced function actually fire until it stops being called.

Actual result

You see the debounced function get called roughly every 1000ms

Environment

SYSTEM INFO:
Obsidian version: v1.5.8
Installer version: v1.4.14
Operating system: Darwin Kernel Version 23.4.0: Wed Feb 21 21:44:43 PST 2024; root:xnu-10063.101.15~2/RELEASE_ARM64_T6000 23.4.0
Login status: not logged in
Insider build toggle: off
Live preview: on
Base theme: dark
Community theme: Border v1.6.2
Snippets enabled: 4
Restricted mode: off
Plugins installed: 11
Plugins enabled: 1
1: Restore Cursor and Scroll Position v1.3.0

There is a param called resetTimeout. Set it to true would let it act as a strict debounce: