Auto-Save a Form with Debounce
For editors, note apps, or any form with auto-save From the Debouncing & Throttling AI Coding Building Block.
My [app] has a form (or text editor) where I want to auto-save the user's work as they type, but without flooding the server with save requests on every keystroke. Set up a debounced auto-save that: - Saves automatically [1 second / 2 seconds] after the user stops editing - Shows a "Saving..." indicator while the save is in progress - Shows "Saved ✓" when the server confirms - If the user keeps typing, resets the timer (doesn't save mid-sentence) - Handles save failures with a retry and a visible warning - Saves immediately when the user navigates away (don't lose work) My stack: [your framework and language here] I'm learning, so explain each part simply.