Debounced auto-save
Automatically persists state through a configured storage adapter after changes settle, using a configurable debounce interval and a max-wait ceiling. Pending saves are flushed on page hide or unload so that no changes are lost.
Planned. This page shows the specification from issue #201. The live example, source for every framework and the API reference replace it when the feature ships.
Live example
A grid with auto-save to an in-memory adapter and a timeline visualising change events and save calls.
Expected behavior
Rapid changes produce a single save after the user goes idle. Continuous activity still saves at least once per max wait. Simulating page hide flushes immediately. With the slow adapter, overlapping saves are serialized and only the latest state is written.
Planned API surface
autoSave: {enabled, debounceMs, maxWaitMs, adapter, include}flushAutoSave()onAutoSaveonAutoSaveErrorAcceptance criteria
- Changes made within debounceMs of each other result in a single save. (pending)
- maxWaitMs guarantees a save during continuous activity. (pending)
- At most one save is in flight at a time. Intermediate states queued during a save are collapsed to the latest one. (pending)
- A pending save is flushed on the visibilitychange event (to hidden) and on pagehide. (pending)
- Saves whose canonical hash equals the last saved hash are skipped. (pending)